perm filename MANUAL.TEX[TEX,DEK]19 blob
sn#465975 filedate 1979-08-11 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00040 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00005 00002 \input manhdr % This is the TEX user manual source text
C00015 00003 \titlepage
C00022 00004 \manmark{Table of Contents}{\chead}\vfill\eject
C00025 00005 \chapterbegin 1. {The name of the game}
C00028 00006 \chapterbegin 2. {Book printing versus ordinary typing}
C00038 00007 \chapterbegin 3. {Controlling \TEX}
C00058 00008 \chapterbegin 4. {Fonts of type}
C00070 00009 \chapterbegin 5. {Grouping}
C00084 00010 \chapterbegin 6. {Running \TEX}
C00117 00011 \chapterbegin 7. {How \TEX\ reads what you type}
C00140 00012 \chapterbegin 8. {The characters you type}
C00150 00013 \chapterbegin 9. {\TEX's standard roman fonts}
C00162 00014 \chapterbegin 10. {Dimensions}
C00168 00015 \chapterbegin 11. {Boxes}
C00182 00016 \chapterbegin 12. {Glue}
C00203 00017 \chapterbegin 13. {Modes}
C00212 00018 \chapterbegin 14. {How \TEX\ breaks paragraphs into lines}
C00233 00019 \chapterbegin 15. {How \TEX\ makes lists of lines into pages}
C00249 00020 \chapterbegin 16. {Typing math formulas}
C00265 00021 \chapterbegin 17. {More about math}
C00286 00022 \chapterbegin 18. {Fine points of mathematics typing}
C00363 00023 \chapterbegin 19. {Displayed equations}
C00383 00024 \chapterbegin 20. {Definitions (also called macros)}
C00395 00025 \chapterbegin 21. {Making boxes}
C00414 00026 \specialchapterbegin 22. {Alignment}
C00441 00027 \chapterbegin 23. {Output routines}
C00462 00028 \chapterbegin 24. {Summary of vertical mode}
C00496 00029 \chapterbegin 25. {Summary of horizontal mode}
C00536 00030 \chapterbegin 26. {Summary of math mode}
C00574 00031 \chapterbegin 27. {Recovery from errors}
C00613 00032 \appbegin A. {Answers to all the exercises}
C00626 00033 \appbegin B. {Basic \TEX\ format}
C00635 00034 \specialappbegin E. {Example of a book format}
C00687 00035 \specialappbegin F. {Font tables}
C00738 00036 \specialappbegin H. {Hyphenation}
C00762 00037 \specialappbegin I. {Index}
C00819 00038 \postindexappbegin S. {Special notes about using \TEX\ at Stanford}
C00824 00039 \specialappbegin X. {Recent extensions to \TEX}
C00834 00040 \end
C00835 ENDMK
C⊗;
\input manhdr % This is the TEX user manual source text
\titlepage
\tenpoint
\null\vskip-46pt
\if01{% The following lines are omitted in the AMS version:
\hbox to size{\:<Stanford Artificial Intelligence Laboratory\hfill January
1979}
\hbox to size{\:<Memo AIM-317.2\hfill(third printing)}
\vskip .25in
\hbox{\:<Computer Science Department}
\hbox{\:<Report No. STAN-CS-78-675}
\vfill
\ctrline{\:<TAU EPSILON CHI, a system for technical text}
\vskip .25in
\ctrline{$\copyright$ 1978 by D. E. Knuth}
}\else{% The following lines are included in the AMS version:
\vfill
\ctrline{\:<TAU EPSILON CHI, a system for technical text}
\vskip .25in
\ctrline{$\copyright$ 1978 by D. E. Knuth}
\vfill
\ctrline{\:b Revised version of Stanford Computer Science report}
\ctrline{\:b number \hbox{\:c STAN-CS-78-675}, originally
published in September, 1978}
\vfill
\ctrline{\:< Published by the}
\ctrline{\:< AMERICAN MATHEMATICAL SOCIETY}
\ctrline{\:< PROVIDENCE, RHODE ISLAND}
\vfill\eject\titlepage\null\vfill
\ctrline{\hbox par 250pt{\:b
The American Mathematical Society has an advisory Standing Committee on
Composition Technology. Currently the Society contemplates the addition
of a \TEX\ capability to its other type\-setting facilities. In addition, the
committee is investigating the development of a \TEX-based system to
permit authors of papers for AMS (and eventually other) journals to ``typeset''
their papers themselves on their own institutions' computer systems. Because
of this expected involvement with \TEX, the AMS has a natural interest in
seeing the development of a strong and healthy \TEX\ users' group, for such
purposes as overseeing the certification of and the distribution of information
on implementations of the \TEX\ system, their maintenance and upward-compatible
enhancements. The above committee announces its readiness to help in the
initial organization of such a users' group. If you feel you might be
interested either in belonging to such a group or in receiving information
from it, please fill out and return one of the reply forms at the back of this
manual.}}
}
\vfill
{\baselineskip 7pt
\:f The author wishes to thank the many individuals who made
helpful comments on the first drafts of this manual, and especially Leo
Guibas for his help in producing copies on experimental graphics printing
equipment. Thanks are also due to
the National Science Foundation and to the Office of Naval Research,
for helping to support the author's research
under grants \hbox{MCS 72-03752 A03} and
\hbox{N00014-76-C-0330}. Since the METAFONT
system for typeface design is still under development, the type fonts used
herein are only initial approximations to the eventual ones.\par}
\if01{}\else{% The following lines are included in the AMS version:
\eject\titlepage\null\vskip-46pt
\ctrline{\hbox par 260pt{\:b
Please fill out and return this sheet to the American Mathematical Society if
you have an interest in participating in a \TEX\ users' group, as described
on the back of the title page.}}
\vfill
{\ninepoint\baselineskip 15pt
\def\lep#1{\hbox par size{\hangindent 10pt \vbox to 12pt{}#1 \leaders\hrule}}
\lep{Date}
\yskip\lep{Name}
\yskip\lep{Title}
\yskip\lep{Institution}
\yskip\lep{Mailing address}
\lep{\quad\!}
\lep{\quad\!}
\lep{\quad\!}
\yskip\lep{\hskip 150pt Phone}
\vfill
\lep{How do you plan to make use of \TEX?}
\lep{\quad\!}
\lep{\quad\!}
\lep{\quad\!}
\lep{\quad\!}
\yskip\lep{To what kind of computing equipment do you have access?}
\lep{\quad\!}
\lep{\quad\!}
\lep{\quad\!}
\lep{\quad\!}
\yskip\lep{Is \TEX\ presently running on that equipment? If not, when will
\TEX\ probably be installed?\!}
\lep{\quad\!}
\lep{\quad\!}
\lep{\quad\!}
\lep{\quad\!}}
\vfill\eject
\def\circle#1{\hbox to 10pt{#1\hskip-7.5ptminus10pt
\raise 6.944pt\hbox{\:@\char'141}\hskip0ptminus10pt}}
\titlepage
\vbox to 2.9in{\ctrline{\:o \circle{\:a3} Staple here}\vfill
\ctrline{\:o \circle{\:a2} Fold here}
\vskip -3pt
\moveleft 3pc\hbox to 35pc{\leaders\hbox{\:f- }\hfill}}
\vbox to 2.65in{\vfill
\hrule height 1pt
\hbox to size{\vbox to .65in{\vfill
\hbox to 21pc{\hfill\:; BUSINESS REPLY MAIL\hfill}
\hbox to 21pc{\hfill\:d NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES\hfill}
\vfill}\!
\vbox to .65in{\vfill
\hbox to 8pc{\hfill\:r FIRST CLASS\hfill}
\hbox to 8pc{\hfill\:e Permit No. 3356\hfill}
\hbox to 8pc{\hfill\:e Providence, R. I.\hfill}
\vfill}}
\hrule height 1pt
\vskip .25in
\baselineskip 15pt
\hbox{\:p Postage will be paid by}
\hbox{\:< AMERICAN MATHEMATICAL SOCIETY}
\hbox{\:< P. O. Box 1571}
\hbox{\:< Annex Station}
\hbox{\:< Providence, Rhode Island\quad 02901}
\vfill}
\moveleft 3pc\hbox to 35pc{\leaders\hbox{\:f- }\hfill}
\ctrline{\:o \circle{\:a1} Fold here}
\vfill\eject
\titlepage
\ctrline{\:o Tear here}
\vskip -3pt
\moveleft 3pc\hbox to 35pc{\leaders\hbox{\:f--- -- }\hfill}
\vfill
\moveleft 3pc\hbox to 35pc{\leaders\hbox{\:f--- -- }\hfill}
\vfill
\vbox to 5in{\hbox to .5in{}\leaders
\hbox{\chop to 0pt{\smallTEX}}\vfill}
\eject\titlepage
\vbox to 3in{\leaders
\hbox to 3in{\lower 5.5556pt\vbox to 11.1111pt{}\leaders
\hbox{\smallTEX\hskip-6.1389pt\lower 5.5556pt\hbox{\chop to 0pt{\smallTEX}}\hskip
-6.1389pt}\hfill}\vfill}
\eject\titlepage
\vbox to 3in{\leaders
\hbox to 3in{\lower 5.5556pt\vbox to 11.1111pt{}\leaders
\hbox{\smallTEX\hskip-6.1389pt\lower 5.5556pt\hbox{\chop to 0pt{\smallTEX}}\hskip
-6.1389pt}\hfill}\vfill}
\eject\titlepage
\vbox to 3in{\leaders
\hbox to 3in{\lower 5.5556pt\vbox to 11.1111pt{}\leaders
\hbox{\smallTEX\hskip-6.1389pt\lower 5.5556pt\hbox{\chop to 0pt{\smallTEX}}\hskip
-6.1389pt}\hfill}\vfill}
\eject\titlepage
\vbox to 3in{\leaders
\hbox to 3in{\lower 5.5556pt\vbox to 11.1111pt{}\leaders
\hbox{\smallTEX\hskip-6.1389pt\lower 5.5556pt\hbox{\chop to 0pt{\smallTEX}}\hskip
-6.1389pt}\hfill}\vfill}
} % end of AMS stuff
\gdef\chead{Preface}
\manmark{\chead}{\chead}
\setcount0 0
\eject
\titlepage
\null\vskip-10pt
\vskip 1.5in plus 1in
\ctrline{\:;TAU EPSILON CHI}
\vskip 13pt
\ctrline{\:q A SYSTEM FOR TECHNICAL TEXT}
\vskip .5in plus .5in
\tenpoint
\noindent\hangindent 25pt for 2
\hbox to 0pt{\hskip-25pt\:@\char'176\hfill}\hskip-6pt
{\:c ENTLE} R{\:c EADER}: This is a handbook about
\TEX, a new typesetting system intended for the creation
of beautiful books---and especially for books that contain a lot of
mathematics. By preparing a manuscript in \TEX\ format, you will be
telling a computer exactly how the manuscript is to be transformed into
pages whose typographic quality is comparable to that of the world's
finest printers; yet you won't need to do much more work than would be
involved if you were simply typing the manuscript on an ordinary
typewriter. In fact, your total work will probably be significantly less,
if you consider the time it ordinarily takes to revise a typewritten manuscript,
since computer text files are so easy to change and to reprocess.\xskip
(If such claims sound too good to be true, keep in mind that they were made
by \TEX's designer, on a day when \TEX\ happened to
be working, so the statements may be biased; but read on anyway.)
This manual is intended for people who have never used \TEX\ before, as
well as for experienced \TEX\ hackers. In other words, it's the only
manual there is. Everything you need to know about \TEX\ is explained
here somewhere, and so are a lot of things that most users don't need to
know. If you are preparing a simple manuscript, you won't need to
know much about \TEX\ at all; on the other hand, some
things that go into the printing of technical books are inherently
difficult, and if you wish to achieve more complex effects you
will want to penetrate into some of \TEX's darker corners. In order
to make it possible for many types of users to read this manual
effectively, a special symbol is used to designate material that is
for wizards only: When the symbol
$$\vbox{\hbox{\:@\char'177}\vskip 11pt}$$
appears at the beginning of a paragraph, it warns of a ``dangerous bend''
in the train of thought; don't read the paragraph unless you need to.
Brave and experienced drivers at the controls of \TEX\ will gradually enter
more and more of these hazardous areas, but for most applications the
details won't matter.
All that you really need to know before reading on is how to get a
file of text into your computer using a standard editing program; this
manual explains what that file ought to look like so that \TEX\ will
understand it, but basic computer usage is not explained here.
Some previous experience with technical typing will be quite helpful
if you plan to do heavily mathematical work with \TEX, although it
is not absolutely necessary. \TEX\ will do most of the necessary
formatting of equations automatically; but users with more experience
will be able to obtain better results, since there are so many ways
to deal with formulas.
Computer system manuals usually make dull reading, but take heart:
This one contains {\:m JOKES} every once in a while, so you might actually
enjoy reading it.\xskip (However, most of the jokes can only be appreciated
properly if you understand a technical point that is being made---so
read {\sl carefully}.)
Another somewhat unique characteristic of this manual is that it doesn't
always tell the truth. When informally introducing certain \TEX\
concepts, general rules will be stated, but later you will find that they
aren't strictly true. The author feels that this technique of deliberate
lying will actually make it easier for you to learn the concepts; once
you learn a simple but false rule, it will not be hard to supplement that
rule with its exceptions.
In order to help you internalize what you're reading, occasional
{\:m EXERCISES} are sprinkled through this manual. It is generally intended
that every reader should try every exercise, except for the exercises that appear
in the ``dangerous bend'' areas. If you can't solve the problem, you
can always look at the answers that appear at the end of the manual.
But please, try first to solve it by yourself; then you'll learn more
and you'll learn faster. Furthermore, if you think you do know the answer to
an exercise, you should turn to the answer pages (Appendix A)
and check it out just to make sure.
\manmark{Table of Contents}{\chead}\vfill\eject
\vskip-12pt\vfill \ctrline{\:;CONTENTS}\vfill
\manmark{Table of Contents}{Table of Contents}\gdef\chead{Table of Contents}
\tenpoint
{\def\\#1. #2. #3.{\hbox to size{\hbox to 20pt{\hfill\bf#1. }#2
\leaders\hrule\hfill\hbox to 20pt{\hfill#3}}}
\\1. The name of the game. 4.
\\2. Book printing versus ordinary typing. 4.
\\3. Controlling \TEX. 7.
\\4. Fonts of type. 12.
\\5. Grouping. 15.
\\6. Running \TEX. 18.
\\7. How \TEX\ reads what you type. 28.
\\8. The characters you type. 33.
\\9. \TEX's standard roman fonts. 36.
\\10. Dimensions. 40.
\\11. Boxes. 41.
\\12. Glue. 45.
\\13. Modes. 50.
\\14. How \TEX\ breaks paragraphs into lines. 52.
\\15. How \TEX\ makes lists of lines into pages. 57.
\\16. Typing math formulas. 60.
\\17. More about math. 64.
\\18. Fine points of mathematics typing. 71.
\\19. Displayed equations. 91.
\\20. Definitions (also called macros). 96.
\\21. Making boxes. 99.
\\22. Alignment. 104.
\\23. Output routines. 109.
\\24. Summary of vertical mode. 114.
\\25. Summary of horizontal mode. 121.
\\26. Summary of math mode. 130.
\\27. Recovery from errors. 138.
\\A. Answers to all the exercises. 148.
\\B. Basic \TEX\ format. 151.
\\E. Example of a book format. 154.
\\F. Font tables. 168.
\\H. Hyphenation. 180.
\\I. Index. 187.
\\S. Special notes about using \TEX\ at Stanford. 198.
\\X. Recent extensions to \TEX. 199.
} % end table of contents
\chapterbegin 1. {The name of the game}
English words like ``technology'' stem from a Greek root beginning with
the letters $\tau\epsilon\chi\ldotsm$; and this same Greek word means {\sl art}
as well as technology. Hence the name \TEX, which is an upper-case form of
$\tau\epsilon\chi$.
Insiders pronounce the $\chi$ of \TEX\ as a Greek chi, not as an ``x'', so that
\TEX\ rhymes with the word blecchhh. It's the ``ch'' sound in Scottish words
like {\sl loch} or German words like {\sl ach}; it's a Spanish ``j'' and a
Russian ``kh''. When you say it properly to your computer, the terminal
may become slightly moist.
The purpose of this pronunciation exercise is to remind you that \TEX\ is
primarily concerned with high-quality technical manuscripts: its emphasis is
on art and technology, as in the underlying Greek word. If you merely want
to produce passably good quality---something acceptable and basically
readable but not really beautiful---a simpler system will usually suffice.
With \TEX\
the goal is to produce the {\sl finest} quality; this requires more attention
to detail, but fortunately it is not that much harder to go this extra
distance, and you can take special pride in the finished product.
On the other hand you might find it more comfortable to pronounce \TEX\ as
a Texan would and to shrug off all this high-falutin' nonsense about beauty
and quality. Go ahead and do what you want, the computer won't mind.
\chapterbegin 2. {Book printing versus ordinary typing}
When you first started using a computer terminal, you probably had to adjust
to the difference between the digit ``1'' and the lower case letter ``l''.
When you take the next step to the level of typography that is common in
book publishing, a few more adjustments of the same kind need to be made.
In the first place, there are two kinds of quotation marks in books, but only
one kind on the typewriter. Even on your computer terminal,
which has more characters
than an ordinary typewriter, you probably have only a non-oriented double-quote
mark ({\tt "}),
because the standard ``ascii'' code for computers was not
invented with book publishing in mind. However, your terminal probably does have
two flavors of single-quote marks, namely ` and ', which you can get by typing
{\≡≡`≡\} and {\≡≡'≡\}. The second of
these is useful also as an apostrophe.
To produce double-quote marks with \TEX, you simply type two single-quote marks
of the appropriate kind. For example, to produce an output like
$$\hbox{``I understand.''}$$
(including the quotation marks) you would type
$$\hbox{\≡≡`≡`I understand.≡'≡'≡\}$$
on your terminal.
A typewriter-like style of type will be used throughout this manual to indicate
\TEX\ constructions you might type on your terminal, so that the
symbols actually typed are readily distinguishable from the output \TEX\ would
produce and from the comments in the manual itself. Here are the symbols to be
used in the examples:
$$\save1\hbox{\≡0123456789"#$%&@*+-=,.:;?!≡\}
\save2\hbox{\≡()<>≡≤≡≥[]{}≡`≡'→↑≡↓←\|/⊗≡spose/=≡∞≡\}
\eqalign{⊗\hbox{\tt ABCDEFGHIJKLMNOPQRSTUVWXYZ}\cr
⊗\hbox{\tt abcdefghijklmnopqrstuvwxyz}\cr
⊗\box1\cr
⊗\box2\cr}$$
If these are not all on your computer terminal, do not despair; \TEX\ can make
do with the ones you have. One additional symbol
$$\hbox{\tt\char'40}$$
is also used to stand for a {\sl blank space}, in case it is important to
emphasize that a blank space is typed; without such a symbol you would have
difficulty seeing the invisible parts of certain examples.
Another important distinction between book printing and ordinary typing is
the use of dashes, hyphens, and minus signs. In good math books, these
symbols are all different; in fact there are usually at least four different
symbols in use:
$$\vbox{\halign{#\hfill\cr
a hyphen (-);\cr
an en-dash (--);\cr
an em-dash (---);\cr
a minus sign ($-$).\cr}}$$
Hyphens are used for compound words like ``nitty-gritty'' and ``Fawcett-Majors''.
En-dashes are used for number ranges like ``pages 13--34'' and also in
contexts like ``exercise 1.2.6--52''. Em-dashes are used for punctuation in
sentences---they are what we often call simply dashes. And minus signs are
used in formulas. A conscientious user of \TEX\ will be careful to distinguish
these four usages, and here is how to do it:
$$\vbox{\halign{#\hfill\cr
for a hyphen, type a hyphen ({\tt -});\cr
for an en-dash, type two hyphens ({\tt --});\cr
for an em-dash, type three hyphens ({\tt ---});\cr
for a minus sign, type a hyphen in mathematics mode ({\≡$-$≡\}).\cr}}$$
(Mathematics mode occurs between dollar signs; it is discussed later, so you
needn't worry about it now.)
\yskip
If you look closely at most well-printed books, you will find that certain
combinations of letters are treated as a unit. For example, this is true of the
``f'' and the ``i'' of ``find''. Such combinations are called {\sl ligatures},
and professional typesetters have traditionally been trained to watch for letter
pairs such as {\tt ff}, {\tt fi}, {\tt fl}, {\tt ffi}, and {\tt ffl}.\xskip (It's
somewhat surprising how often these combinations appear.) Fortunately you do
{\sl not} have to concern yourself with ligatures, since \TEX\ is perfectly
capable of handling such things by itself. In fact, \TEX\ will also look
for combinations of adjacent letters (like ``{\tt A}'' next to ``{\tt V}'')
that ought to be moved closer together for better appearance; this is
called {\sl kerning}.
\yyskip
To summarize this chapter: When using \TEX\ for straight copy, you type the copy as
on an ordinary typewriter, except that you need to be careful about quotation
marks, the number 1, and various kinds of hyphens/dashes. \TEX\ will take
care of other niceties like ligatures and kerning.
\danger In case you need to type quotes within quotes, for example a single quote
followed by a double quote, you can't simply type {\≡≡'≡'≡'≡\} because \TEX\
will interpret this as ''' (namely, double-quote followed by single-quote).
If you have already read Chapter 5, you might expect that the solution will be to
use grouping---namely, to type something like
{\≡{≡'}≡'≡'≡\}. But it turns out that this doesn't produce the
desired result, because there is usually more space following a double quote
than there is following a single quote: What you get is '{}'', which is indeed
a single quote followed by a double quote (if you look at it closely enough),
but it looks almost like three equally-spaced single quotes.
On the other hand, you certainly won't want to type {\≡≡'≡char'40≡'≡'≡\}, because
this space is much too large---just as large as the space between words---and
\TEX\ might even start a new line at such a space when making up a
paragraph! There are at
least two ways to solve the problem, both of which involve more complicated
features of \TEX\ that we shall study later. First, if you
have a definition such as
$$\hbox{\≡\def\2{\hbox to 2pt{}}≡\}$$
in the format of your manuscript, you can type {\≡≡'\2≡'≡'≡\}.
This definition puts 2 points of blank space
between the quotes, so the result is '\hbox to 2pt{}''; you could, of
course, vary the amount of space, or define another control sequence besides
{\≡\2≡\} for this purpose. Second, you could use the idea of ``thin space'' in
math formulas: namely, if you type {\≡≡'$\,$≡'≡'≡\} the result will be '$\,$''.
\danger\exno 2.1: OK, now you know how to produce ''' and '$\,$''; how do you
get ``$\,$` and `{}``$\,$?\enddanger
\chapterbegin 3. {Controlling \TEX}
Your keyboard has very few keys compared to the large number of symbols you
may want to specify. In order to make a limited keyboard sufficiently versatile,
one of the characters you can type is reserved for special use, and it is called
the {\sl escape character}. Whenever you want to type something that controls the
format of your manuscript, or something that doesn't use the keyboard in the
ordinary way, you type the escape character followed by an indication of what
you want to do.
You get to choose your own escape character. It can be any typeable symbol,
preferably some character found in a reasonably convenient location on your
keyboard, yet it should be a symbol that is rarely (if ever) used in the manuscript
you are typing. For our purposes in this manual, the ``backslash'' character
``{\≡\≡\}''
will be used as the escape in all the examples. You may wish to adopt backslash as
your personal escape symbol, but \TEX\ doesn't have any character built in for this
purpose. In fact, \TEX\ always takes {\sl the first nonblank character} you give it
and assumes that it is to be your escape character.
Note: Some computer terminals have a key marked ``{\tt ESC}'', but that is {\sl not}
your escape character! It is a key that sends a special message to the operating
system, so don't confuse it with what this manual calls ``escape''.
Immediately after typing ``{\≡\≡\}''
(i.e., immediately after an escape character) you
type a coded command telling \TEX\ what you have in mind. Such commands are called
{\sl control sequences}. For example, you might type
$$\hbox{\≡\input ms≡\}$$
which (as we will see later) causes \TEX\ to begin reading a file called ``{\tt
ms.TEX}''; the string of characters ``{\≡\input≡\}'' is a control sequence.
Here's another example:
$$\hbox{\≡George P\≡'olya and Gabor Szeg\"o.≡\}$$
\TEX\ converts this to ``George P\'olya and Gabor Szeg\"o.'' There are two
control sequences, {\≡\≡'≡\} and {\≡\"≡\}, in this example, and they are used
to indicate the special accents.
Control sequences come in two flavors. The first kind, like {\≡\input≡\}, consists
of the escape character followed by one or more letters, followed by a space or by
something besides a letter.\xskip
(\TEX\ has to know where the control sequence ends,
so you have to put a space after a control sequence if the following character is
a letter; for example, if you type ``{\≡\inputms≡\}'', \TEX\ will interpret this as
a control sequence with seven letters.)\xskip
The second variety of control sequence,
like {\≡\≡'≡\}, consists of the escape character
followed by a single {\sl nonletter}. In this case you don't need a space to
separate the control sequence from a letter that follows, since control
sequences of the second kind always have a single symbol after the escape.
When a space comes after a control sequence (of either kind), it is ignored by
\TEX; i.e., it is not considered to be a ``real'' space belonging to the
manuscript being typeset. Thus, the example above could have been
typed as
$$\hbox{\≡George P\≡'≡ olya and Gabor Szeg\" o.≡\}$$
\TEX\ will treat both examples the same way; it {\sl always} discards spaces
after control sequences.
So the question arises, what do you do if you actually {\sl want} a space to
appear after a control sequence? We will see later that \TEX\ treats two or
more consecutive spaces as a single space, so the answer is {\sl not} going to be
``type two spaces.'' The correct answer is to type ``escape space'', namely
$$\hbox{\≡\≡char'40≡\}$$
(the escape character followed by a blank space); \TEX\ will treat this as
a space not to be ignored. Note that escape-space is a control sequence of the
second kind, since there is a single nonletter ({\tt\char'40}) following the
escape character. According to the rules, further spaces immediately following
{\≡\≡char'40≡\} will be ignored, but if you want to enter, say, three consecutive
spaces into a manuscript you can type ``{\≡\≡char'40\≡char'40\≡char'40≡\}''.
Incidentally, typists are often taught to put two spaces at the ends of
sentences; but we will see later that \TEX\ has its own way to produce extra space
in such cases. Thus you needn't be consistent in the number of spaces you type.
It is usually unnecessary for you to use ``escape space'', since control sequences
aren't often needed at the ends of words. But here's an example that might shed
some light on the matter: This manual itself has been typeset by \TEX, and one of
the things that occurs fairly often is the tricky logo ``\TEX'', which requires
backspacing and lowering the E. We will see below that it is possible for any
user to define new control sequences to stand as abbreviations of commonly
occurring constructions; and at the beginning of this manual, a special definition
was made so that the control sequence$$\hbox{\≡\TEX≡\}$$ would produce the
instructions necessary to typeset ``\TEX''. When a phrase like
``\TEX\ ignores spaces after control sequences.'' is to be typeset, the manuscript
renders it as follows:
$$\hbox{{\≡\TEX\ ignores spaces after control sequences≡\}.}$$
Notice the extra {\≡\≡\} following {\≡\TEX≡\}; this produces the escape-space
that is necessary because \TEX\ ignores spaces after control sequences. Without
this extra {\≡\≡\}, the result would have been
$$\hbox{\TEX ignores spaces after control sequences.}$$
Consider also what happens if {\≡\TEX≡\} is not followed by a space, as in
$$\hbox{{\≡the logo ≡`≡`\TEX≡'≡'≡\}.}$$
It would be permissible to put a blank space after the {\tt X}, but not an
escape character; if the manuscript were changed to read
$$\hbox{\≡the logo ≡`≡`\TEX\≡'≡'≡\}$$
the result would be curious indeed---can you guess it?\xskip Answer: The {\≡\≡'≡\}
would be a control sequence denoting an acute accent, as in our {\≡P\≡'olya≡\}
example above; the effect would therefore be to put an accent over the
next nonblank character,
which as it happens is a single-quote mark. In other words, the result would be
$$\hbox{the logo ``\TEX\''}$$
because the ligature that changes {\≡≡'≡'≡\} into '' is not recognized.
\yskip\noindent
\exno 3.1: State two ways to specify the French word ``math\'ematique''. Can
you guess how the word ``centim\`etre'' should be specified?
\yskip
$ $% begin paragraph
\TEX\ understands almost 300 control sequences as part of its standard
built-in vocabulary,
and all of these are explained in this manual somewhere. Fortunately you won't
have too much trouble learning them, since the vast majority are simply the
names of special characters used in mathematical formulas. For example, the
control sequences {\≡\Ascr≡\}, {\≡\Bscr≡\}, $\ldotss$, {\≡\Zscr≡\} stand for
the upper case script letters $\Ascr$, $\Bscr$, $\ldotss$, $\Zscr$; and you can
type ``{\≡\aleph≡\}'' to get $\aleph$, ``{\≡\doteq≡\}'' to get $\doteq$,
``{\≡\oplus≡\}'' to
get $\oplus$, ``{\≡\←≡\}'' to get $\←$, etc.
As mentioned above, \TEX\ can be taught to understand other control sequences
besides those in its primitive vocabulary. For example, ``{\≡\TEX≡\}'' is not one of
the standard control sequences; it had to be defined specially for producing
this manual. In general there will be special control sequences that define the
{\sl style} of a book or a series of books: they will be used at the beginning of
chapters, or to handle special formats such as might be used in a bibliography,
etc. Such style-defining control sequences are usually defined once and for all
by \TEX perts skilled in the lore of control-sequence definition, and novice
\TEX\ users don't have to worry about the job of defining any new control
sequences; the only problem is to learn how to use somebody else's definitions.\!
\xskip
(The person who designs a \TEX\ style is obliged to write a supplement to this
manual explaining how to use his or her control sequences.)
In this manual we shall frequently refer to a so-called ``basic \TEX\ style''
consisting of the definitions in Appendix B, since these basic definitions
have proved to be useful for common one-shot jobs; and since they probably also
will be included as a part of more elaborate styles. Appendix E contains an
example of a more elaborate style, namely the definitions used to typeset
D. E. Knuth's series of books on {\sl The Art of Computer Programming}. There's
no need for you to look at these appendices now, they are included only for
reference purposes.
The main point of these remarks, as far as novice \TEX\ users are concerned, is
that it is indeed possible to define nonstandard \TEX\ control sequences, but it
can be tricky. You can safely rely on the standard control sequences, and
on the basic extensions defined in Appendix B (which will be explained later in this
manual), until you become an experienced \TEX nical typist.
\danger Those of you who wish to define control sequences should know that \TEX\
has further rules about them, namely that many different spellings of the same
control sequence may be possible. This fact allows \TEX\ to handle control
sequences quite efficiently; and \TEX's usefulness is not seriously affected,
because new control sequences aren't needed very often.
A control sequence of the first kind (i.e., one
consisting of letters only) may involve both upper case and lower case letters,
but the distinction between cases is ignored after the first letter. Thus {\≡\TEX≡\}
could also be typed ``{\≡\TEx≡\}'' or ``{\≡\TeX≡\}'' or ``{\≡\Tex≡\}''---each
of these four
has the same meaning and the same effect. But ``{\≡\tex≡\}'' would {\sl not} be the
same, because there {\sl is} a case distinction on the first letter.\xskip (Typing
``{\≡\gamma≡\}'' results in $\gamma$, but ``{\≡\Gamma≡\}'' or ``{\≡\GAMMA≡\}''
results in $\GammA$.)
\danger Another rule takes over when there are seven or more letters after the
escape:
all letters after the seventh are replaced by ``{\tt x}'', and then groups of
eight letters are removed if necessary until at most 14 letters are left.
Thus {\≡\underline≡\} is the same as {\≡\underlixx≡\}; and it is also the same
as {\≡\underlinedsymbols≡\} or any other control sequence that starts with
{\≡\u≡\} followed by {\tt n} or {\tt N}, then {\tt d} or {\tt D}, then {\tt e} or
{\tt E}, then {\tt r} or {\tt R}, then {\tt l} or {\tt L}, then {\tt i} or
{\tt I}, then 2 or 10 or 18 or 26 or $\cdots$ letters. But {\≡\underline≡\} is
not the same as {\≡\underlines≡\}, because these two control sequences don't
have the same length modulo 8.
\danger As a consequence of these rules, there are 128 essentially distinct control
sequences of length two---namely, escape followed by any 7-bit character, whether a
letter or not. There are $52\times26$ essentially distinct control sequences of
length three, because there are $26+26=52$ choices for the first letter following
the escape and 26 different choices for the second letter; there are
$52\times26\times26$ essentially distinct control sequences of length four,
$52\times26\times26\times26$ of length five, $52\times26\times26\times26\times26$
of length six, $52\times26\times26\times26\times26\times26$ of length seven.
There are $52\times26\times26\times26\times26\times26\times26$ essentially
distinct control sequences of length 8 plus a multiple of 8, and the same number
holds for length 9 plus a multiple of 8, $\ldotss$, length
15 plus a multiple of 8. Thus
the total number of distinct control sequences available is exactly
$$128+52\cdot26+52\cdot26↑2+52\cdot26↑3+52\cdot26↑4+52\cdot26↑5+8\cdot52\cdot26↑6
=129151507704;$$
that should be enough. Even though \TEX\ accepts alternative spellings, you should
be consistent in each manuscript, since some implementations of \TEX\ may not be
exactly the same in this respect.
\danger Nonprinting control characters like $\langle\hbox{carriage-return}\rangle$
might follow an
escape character, and these lead to distinct control sequences according to the
rules. Initially \TEX\ is set up to treat {\≡\≡\}$\langle$tab$\rangle$ and
{\≡\≡\}$\langle\hbox{line-feed}\rangle$ and {\≡\≡\}$\langle
\hbox{vertical-tab}\rangle$ and {\≡\≡\}$\langle\hbox{form-feed}\rangle$ and
{\≡\≡\}$\langle\hbox{carriage-return}\rangle$ the same as {\≡\≡char'40≡\}
(escape space); it is recommended that none of these six control sequences
be redefined.\enddanger
\chapterbegin 4. {Fonts of type}
Occasionally you will want to change from one typeface to another, for example
if you wish to be {\bf bold} or to {\sl emphasize} something. \TEX\ deals with
sets of 128 characters called ``fonts'' of type, and the control sequence
{\≡\:≡\} is used to select a particular font. If, for example, fonts {\tt n},
{\tt b}, and {\tt s} have been predefined to represent normal, bold, and
slanted styles of type, you might specify the last few words of the first
sentence of this paragraph in the following way:
$$\hbox{\≡to be \:b bold \:n or to \:s emphasize \:n something.≡\}$$
(Blank spaces after font codes like {\tt b} are ignored by \TEX\ just like
the spaces after control sequences; furthermore, since a font code is always of
length 1, you don't need a space after it. Thus, {\≡\:bbold≡\} would be treated
the same as {\≡\:≡char'40b≡char'40≡char'40bold≡\}.
It is probably best to type a space after the font codes, even though you
don't really need one, for the sake of readability.)
You probably will never\footnote*{Well$\ldotsm$, hardly ever.}
use the {\≡\:≡\} sequence yourself, since
the predesigned format you are using usually includes special control sequences
that give symbolic names to the fonts. For example, the ``basic \TEX\ format''
in Appendix B defines three control sequences for this purpose.
$$\vbox{\halign{# \hfill⊗#\hfill\cr
{\≡\rm≡\} switches to the normal ``Roman'' typeface: ⊗Roman\cr
{\≡\sl≡\} switches to a slanted typeface:⊗{\sl Slanted}\cr
{\≡\bf≡\} switches to a boldface style:⊗{\bf Bold}\cr}}$$
With such a system, you can type the above example as
$$\hbox{\≡to be \bf bold \rm or to \sl emphasize \rm something.≡\}$$
The advantage of such control sequences is that you can use the same abbreviations
{\≡\rm≡\}, {\≡\sl≡\}, {\≡\bf≡\} in any size of type, although different font
codes are actually used for different sizes. For example, fonts {\tt a},
{\tt n}, {\tt q} might be the normal, slanted, and bold fonts in a standard
``10-point'' size of type, while {\tt c}, {\tt p}, {\tt s} might be the
corresponding fonts in a smaller ``8-point'' size. It would be difficult to
remember how the codes change in different sizes. So the {\sl Art of Computer
Programming} book design in Appendix E allows you to say
$$\hbox{\≡\tenpoint≡\}$$
whenever you are beginning to type material that belongs in 10-point size,
after which {\≡\rm≡\} will be equivalent to {\≡\:a≡\}, and {\≡\sl≡\} will be
equivalent to {\≡\:n≡\}, etc. Now if you switch to 8-point size (in a
footnote, say) the instruction
$$\hbox{\≡\eightpoint≡\}$$
(which appears in the {\≡\footnote≡\} format) will cause {\≡\sl≡\} to be
equivalent to {\≡\:p≡\}. All you need to remember is the abbreviations
{\≡\rm≡\}, {\≡\sl≡\}, and {\≡\bf≡\} regardless of what type size you are using.
\yyskip
There actually is a better way yet to handle the above example, using \TEX's
``grouping'' feature, which we shall discuss in the next chapter. With this
feature you would type
$$\hbox{\≡to be {\bf bold} or to {\sl emphasize} something.≡\}$$
As we will see, switching fonts within {\≡{≡\} and {\≡}≡\} does not affect
the fonts outside, so you don't need to say explicitly that you are returning to
{\≡\rm≡\} in this scheme. Thus, you can pretty much forget about the other
ways we have been discussing for font switching; it's best to use grouping.
\danger When you do use the {\≡\:≡\} instruction to change fonts, here are
the rules you need to know. \TEX\ can handle up to 32 different fonts in
any particular job (counting different sizes of the same style). These
32 fonts are distinguished by the least significant five bits of the 7-bit
ascii character code you type following ``{\≡\:≡\}''; if you don't understand
what this means, use the following code names for your fonts:
$$\vbox{\def\\#1#2{{\tt #1} or {\tt #2}}\tabskip 0pt plus 1pt
\halign to size{\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill
⊗\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill\cr
Internal⊗\TEX⊗Internal⊗\TEX⊗Internal⊗\TEX⊗Internal⊗\TEX\cr
font⊗font⊗font⊗font⊗font⊗font⊗font⊗font\cr
number⊗code⊗number⊗code⊗number⊗code⊗number⊗code\cr
\noalign{\vskip 3pt}
1⊗\\@{\char'15}⊗\hskip5pt 9⊗\\Hh⊗17⊗\\Pp⊗25⊗\\Xx\cr
2⊗\\Aa⊗10⊗\\Ii⊗18⊗\\Qq⊗26⊗\\Yy\cr
3⊗\\Bb⊗11⊗\\Jj⊗19⊗\\Rr⊗27⊗\\Zz\cr
4⊗\\Cc⊗12⊗\\Kk⊗20⊗\\Ss⊗28⊗\\[;\cr
5⊗\\Dd⊗13⊗\\Ll⊗21⊗\\Tt⊗29⊗\\<{\char'32}\cr
6⊗\\Ee⊗14⊗\\Mm⊗22⊗\\Uu⊗30⊗\\]=\cr
7⊗\\Ff⊗15⊗\\Nn⊗23⊗\\Vv⊗31⊗\\>{\char'136}\cr
8⊗\\Gg⊗16⊗\\Oo⊗24⊗\\Ww⊗32⊗\\?←\cr}}$$
You never refer to a font by its number, always by its code.
Code {\tt A} is treated the same as {\tt a}, etc.; but a wise typist will
consistently use the same codes in any particular manuscript, because later
\TEX s may allow more than 32 fonts.
\danger Of course \TEX\ can make use of hundreds of different fonts in different
jobs. The 32-font restriction applies only within a particular job, because
\TEX\ doesn't want to keep the details about more than $32\times128=4096$
characters in its memory at once; there isn't enough room.
Thus the internal font codes will refer, in
general, to different ``real'' fonts. The first time you use a font code, you
must {\sl define} it by giving the full name of the font in the system's
collection. For example, when the basic \TEX\ format in Appendix B says
$$\hbox{\≡\:a=cmr10≡\}$$
this selects font code {\tt a} and defines it to be the system's font ``cmr10'',
an abbreviation for ``Computer Modern Roman 10 point''. The rule for defining a
font is that the font code ({\tt a} in this example) must be followed immediately
by ``{\tt=}'' or ``{\tt←}'' (not a space) when it first appears, and this
must be followed immediately by the system name of the font file; then comes a
blank space to denote the end of the font file name.
\danger Once a font code is defined, it can never be redefined again. Thus if
you type, say, ``{\≡\:a=cmr10≡\}'' when font code {\tt a} has already been defined,
the characters ``{\tt =cmr10}'' will be treated as part of your manuscript, and
they will dutifully be set into type (in font {\tt a}). It's best to define
all your fonts in format specifications at the very beginning of your
input.\enddanger
When you change fonts within a line, \TEX\ will line the letters up according to
their
``baselines.'' For example, suppose that font codes {\tt a}, {\tt b}, {\tt c},
{\tt d}, {\tt e}, {\tt f} refer respectively to 10-point, 9-point, 8-point,
7-point, 6-point, and 5-point roman fonts; then if you type
$$\vbox{\halign to 335pt{#\hfill\cr
{\≡\:a smaller \:b and smaller \:c and smaller≡\}\cr
{\≡\:d and smaller \:e and smaller \:f and smaller \:a≡\}\cr}}$$
the result is smaller \:b and smaller \:c and smaller \:d and smaller \:e
and smaller \:f and smaller\:a. Of course this is something authors don't
do very often at the moment, because printers can't do such things
easily with traditional lead types. Perhaps poets who wish to
speak in \:f a still small voice \:a will cause future books to make use of
frequent font variations, but nowadays it's only an occasional font freak \:f(like
the author of this manual)\:a\ who likes it. One should not get too carried away
by the prospect of font switching unless there is good reason.
\yyskip
\noindent\exno 4.1: Explain how to type the bibliographic reference ``Ulrich Dieter,
{\sl Journal f\"ur die reine und angewandte Mathematik \bf 201} (1959), 37--70.''
\chapterbegin 5. {Grouping}
Every once in a while it is necessary to treat part of a manuscript as a unit,
so you need to indicate in some fashion where that part begins and ends.
For this purpose \TEX\ gives special interpretation to two ``grouping characters''
(just as it treats the escape character in a special way).
We shall assume in this manual that {\≡{≡\} and {\≡}≡\} are the grouping
characters, although any other typeable characters may be reserved for this
function.
We saw one example of grouping in the previous chapter, where it was pointed out
that font changes inside a group do not affect the fonts in force outside. This
gives the effect of what computer scientists call ``block structure.'' Another
example of grouping occurs when you are using certain control sequences; for
example, if you want to center something on a line you can type
$$\hbox{\≡\ctrline{This information will be centered.}≡\}$$
using the control sequence {\≡\ctrline≡\} defined in basic \TEX\ format
(Appendix B).
Grouping is used in quite a few of \TEX's more complex instructions, although it
is largely unnecessary in simple manuscripts. Here's an example of a slightly more
complex case, the definition of a new control sequence {\≡\rm≡\} as mentioned
in the previous chapter:
$$\hbox{\≡\def\rm{\:a}≡\}$$
This means that control sequence {\≡\rm≡\} is henceforth to be replaced in the
input by the control sequence {\≡\:≡\} followed by {\tt a}. One can also have
{\sl groups within groups}, e.g.,
$$\hbox{\≡\def\tenpoint{\def\rm{\:a}\def\sl{\:n}\def\bf{\:q}}≡\}$$
which means that the control sequence {\≡\tenpoint≡\} is henceforth to be replaced
in the input by
$$\hbox{\≡\def\rm{\:a}\def\sl{\:n}\def\bf{\:q}≡\}$$
and these, in turn, describe replacements for the control sequences {\≡\rm≡\},
{\≡\sl≡\}, and {\≡\bf≡\}. If you are a novice \TEX\ user, you will probably
not be using {\≡\def≡\} yourself to define control sequences; the point of this
example is merely to demonstrate that groups can indeed arise within groups.
\danger Groups within groups will happen only in rather complicated situations,
but in such cases it is extremely important that you don't leave out a {\≡{≡\}
or a {\≡}≡\}, lest \TEX\ get hopelessly confused. For example, the
{\≡\output≡\} routine in Appendix E has as many as five levels of groups within
groups within $\ldotss$; although each level is fairly simple by itself, the
total cumulative effect can boggle the mind, so the author had to try three
times before getting the {\≡{≡\}'s and {\≡}≡\}'s right. In such situations
there is a handy rule for figuring out which {\≡{≡\} goes with which {\≡}≡\},
and whether or not you have forgotten any braces.
Start with a mental count of zero, and go from left to right in your \TEX\
input. When you get to a {\≡{≡\}, add one to the count, and write the resulting
number lightly above the {\≡{≡\}. When you get to a {\≡}≡\}, write the current
count lightly above it and {\sl then} subtract one from the count. For example,
$$\vbox{\halign{#⊗\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill
⊗\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill
⊗\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill
⊗\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill
⊗\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill
⊗\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill⊗\hfill#\hfill
⊗\hfill#\hfill⊗\hfill#\hfill\cr
⊗⊗1⊗⊗2⊗⊗2⊗⊗2⊗⊗3⊗⊗3⊗⊗3⊗⊗3⊗⊗2⊗⊗2⊗⊗2⊗⊗1\cr
⊗$\ldotsm$⊗{\≡{≡\}⊗$\ldotsm$⊗{\≡{≡\}⊗$\ldotsm$⊗{\≡}≡\}\!
⊗$\ldotsm$⊗{\≡{≡\}⊗$\ldotsm$⊗{\≡{≡\}⊗$\ldotsm$⊗{\≡}≡\}⊗$\ldotsm$⊗{\≡{≡\}\!
⊗$\ldotsm$⊗{\≡}≡\}⊗$\ldotsm$⊗{\≡}≡\}⊗$\ldotsm$⊗{\≡{≡\}⊗$\ldotsm$⊗{\≡}≡\}⊗$\ldotsm$\!
⊗{\≡}≡\}⊗$\ldotsm$\cr
Current count:⊗0⊗⊗1⊗⊗2⊗⊗1⊗⊗2⊗⊗3⊗⊗2⊗⊗3⊗⊗2⊗⊗1⊗⊗2⊗⊗1⊗⊗0\cr}}$$
If the input is properly grouped, your count will return to zero, and it will
never become less than zero. The {\≡{≡\} corresponding to any particular
{\≡}≡\} is the nearest preceding {\≡{≡\} having the same number as the {\≡}≡\}.\!
\xskip
(You need not apply this procedure to the entire input manuscript, just to any part
that is supposed to be understood as a unit. For example, you can
apply this procedure to the right-hand side of any definition that uses {\≡\def≡\}.)
\enddanger
Suppose that you had typed
$$\hbox{\≡\ctrline{This information will be {\sl centered}.}≡\}$$
Then you would have gotten
$$\hbox{This information will be {\sl centered}.}$$
Now suppose that you type
$$\hbox{\≡\ctrline{This information will be {centered}.}≡\}$$
What do you think will happen? Answer: you will get
$$\hbox{This information will be {centered}.}$$
The result looks
just as if those innermost braces had not appeared at all, because you haven't
used the grouping to change fonts or anything. \TEX\ doesn't mind if you want to
waste your time making groups for no reason.
Actually there is a reason why you might want to use grouping without font
changes, etc., namely when you want to make sure that spacing comes out right.
In Chapter 3 we discussed the control sequence {\≡\TEX≡\} that the
author of this manual has used to get the logo ``\TEX'', and we observed that
the space after {\≡\TEX≡\} is ignored since {\≡\TEX≡\} is a control sequence.
Thus it was apparently necessary to type ``{\≡\TEX\≡char'40≡\}'' when there was
supposed to be a space following ``\TEX'', but it was a mistake to type
``{\≡\TEX\≡\}''
when the next character was to be a punctuation mark or something else
besides a space. Well, in {\sl all} cases it would be correct to type
$$\hbox{\≡{\TEX}≡\}$$
whether or not the following character is a space, because the {\≡}≡\} stops
\TEX\ from looking for the optional space after {\≡\TEX≡\}.
This might come in handy when you're using a text editor
(e.g., when replacing all occurrences of a particular word by a control sequence).
Another thing you could do is type
$$\hbox{\≡\TEX{}≡\}$$
using an {\sl empty} group for the same purpose: the {\≡{}≡\} here is a group of
no characters, so it produces no output, but it does have the effect of shutting
off \TEX's scan for blanks.
\yskip
\noindent\exno 5.1: Suppose you want to specify two hyphens in a row; you can't type
``{\tt --}'' because \TEX\ will read that as an en-dash, so what can you do?
\danger When \TEX\ starts any job, all characters are alike; there is no
escape character, and there are no grouping characters. \TEX\ automatically
makes the first nonblank input character the escape, but if a manuscript is going to
use grouping, the grouping characters must be ``turned on.'' The basic
format in Appendix B does this, and you can do it yourself in the following way:
Type ``{\≡\chcode≡\}$\langle$number$\rangle${\≡←1≡\}'' for the left delimiter and
``{\≡\chcode≡\}$\langle$number$\rangle${\≡←2≡\}'' for the right delimiter, where
$\langle$number$\rangle$ is the numeric value of the 7-bit code for the
desired character. For example, ``{\≡{≡\}'' and ``{\≡}≡\}''
have the respective codes
\char'16 173 and \char'16 176 at Stanford---this is a local deviation from
some ascii codes at other places---so the instructions
$$\hbox{\≡\chcode≡'173←1 \chcode≡'176←2≡\}$$
appear among the basic format definitions in Appendix B.\xskip
(Numbers beginning with
\char'16\ are in octal notation, cf.\ Chapter 8.)\xskip
It is possible to have several
characters simultaneously serving as group delimiters, simply by using
{\≡\chcode≡\} to specify each of them.
\danger Font changes are not the only things that ``stay inside'' a group
without affecting the text outside. This same localization applies to any control
sequences defined within the group (except those using {\≡\gdef≡\} in place of
{\≡\def≡\}); to glue-spacing parameters such as those set by {\≡\baselineskip≡\}
and {\≡\tabskip≡\}; to \TEX\ control parameters such as those set by
{\≡\trace≡\} and {\≡\jpar≡\}; and to the character interpretations set by
{\≡\chcode≡\}. But localization does {\sl not} apply to definitions of
{\≡\output≡\} routines,
or to the size parameters set by {\≡\hsize≡\}, {\≡\vsize≡\}, {\≡\parindent≡\},
{\≡\maxdepth≡\}, and {\≡\topbaseline≡\}. Furthermore, if you type
``{\≡{\:a=cmr10}≡\}'', the ``{\tt cmr10}'' part of this font definition
still is irrevocably tied to code {\tt a}.
\danger \exno 5.2: Would {\≡\def\rm{{\:a}}≡\} have the same effect as the definition
{\≡\def\rm{\:a}≡\}?\xskip (The only difference is an extra level of grouping.)
\danger
\exno 5.3: Suppose {\≡\chcode≡'74←1 \chcode≡'76←2 ≡\}appears near the beginning
of a group that begins with {\≡{≡\}; these specifications instruct \TEX\ to
treat {\tt<} and {\tt>} as group delimiters. According to the rules above, the
characters {\tt<} and {\tt>} will revert to their previous meaning when the
group ends; but should the group end with {\≡}≡\} or with {\tt>}?\enddanger
\chapterbegin 6. {Running \TEX}
The best way to learn how to do something is to do it, and the best way to
learn how to use \TEX\ is to use it. Thus, it's high time for you to sit
down at a computer terminal and interact with the \TEX\ system, trying things
out to see what happens. Here are some small but complete examples suggested
for your first encounter. The examples are presented in terms of the Stanford
WAITS system; slightly different conventions may be in use at other installations.
Caution: This chapter is rather a long one. Why don't you stop reading now, and
come back to this tomorrow?
\yyskip OK, let's suppose that you're rested and excited about having a trial run of
\TEX. Step-by-step instructions for using it appear in this chapter. First do
this: Go to the lab where the graphic output device is, since you
will be wanting to see the output that you get---it won't really be satisfactory
to generate new copy with \TEX\ from a remote location. Then log in; and when
the operating system types ``{\tt .}'' at you, type back
$$\hbox to size{\hskip25pt{\≡r tex≡\}}$$
(followed by $\langle\hbox{carriage-return}\rangle$). This causes \TEX\ to start
up, and when it is ready it will type ``{\tt*}''. Now type
$$\hbox to size{\hskip25pt\≡\input basic≡\}$$
and $\langle\hbox{carriage-return}\rangle$; this causes the basic \TEX\
format of Appendix B to be read into the system. \TEX\ will type
$$\hbox to size{\hskip25pt\≡(basic.TEX 1 2 3 4)≡\}$$
on your terminal as it is processing this material, meaning that it has read pages
1, 2, 3, and 4 of this file. Then it types ``{\tt*}'', waiting for more input.
At this point the {\≡\rm≡\} font has been selected, which is the ``normal''
cmr10 font, and \TEX\ is ready to accept an input manuscript using the
basic conventions.
Now type several more lines, each followed by $\langle\hbox
{carriage-return}\rangle$:
$$\halign{\hskip 25pt #\cr
{\≡\hsize 2 in≡\}\cr
{\≡\vskip 1 in≡\}\cr
{\≡\ctrline{MY STORY}≡\}\cr
{\≡\vskip 36 pt≡\}\cr
{\≡\ctrline{\sl by A. U. Thor}≡\}\cr
{\≡\vskip 2.54 cm≡\}\cr
{\≡Once upon a time, in a distant≡\}\cr
{\≡galaxy called \error \"O\"o\c c,≡\}\cr
{\≡there lived a computer≡\}\cr
{\≡named R. J. Drofnats. \par≡\}\cr
{\≡Mr. Drofnats---or ≡`≡`R. J.,≡'≡'≡ as≡\}\cr
{\≡he preferred to be called---≡\}\cr
{\≡was lousy at typesetting, but he≡\}\cr
{\≡had other nice qualities. For≡\}\cr
{\≡example, he gave error messages≡\}\cr
{\≡when a typist forgot to end a paragraph≡\}\cr
{\≡properly. \end≡\}\cr
{\≡\par\vfill\end≡\}\cr}$$
This example is a bit long, and more than a bit silly, but it's no trick for
a good typist like you and it will give you some worthwhile experience, so please
do it. For your own good.
Incidentally, the example introduces a few more features that you might as well
learn as you are typing, so it's probably best for you to type a line, then read
the explanation that appears below, then type the next line and so on.
\yskip
The instruction ``{\≡\hsize 2 in≡\}'' says that rather narrow lines will be set,
only 2 inches wide.\xskip (On a low-resolution device like the XGP currently
used at Stanford,
``{\tt 2 in}'' really means about 2.6 inches, because \TEX\ expects that its
output on such devices will be used only for proofreading, or that the output
will be reduced to about 77\char'45\ of its physical size before actual printing.
The 10-point type cmr10 will actually appear to be essentially the same
size as 13-point type
in books; in other words, you should expect to see output ``larger
than life.'')
The instruction ``{\≡\vskip 1 in≡\}'' means a {\sl vertical skip} of one inch.\!
\xskip
(Really 1.3 inches, on an XGP or VERSATEC, but from now on we won't mention
this expansion.)\xskip
Then the instruction ``{\≡\ctrline{MY STORY}≡\}'' causes a line
of type that says ``MY STORY'' to be centered in the 2-inch column.\xskip
(Recall from
Chapter 5 that \TEX's basic formats, which we loaded by typing ``{\≡\input
basic≡\}'',
include this {\≡\ctrline≡\} and grouping facility for centering things.)
The instruction ``{\≡\vskip 36 pt≡\}'' is another vertical skip, this time by the
amount 36 points---which is a printer's measure slightly less than half an inch.
Book measurements have traditionally been specified in units of picas and points,
and \TEX\ does not want to shake printers up too badly, so it allows a variety
of different units of length to be specified.
The instruction ``{\≡\ctrline{\sl by A. U. Thor}≡\}'' makes another cen\-tered line,
this time in the slanted 10-point font (because of the {\≡\sl≡\}). This
{\≡\sl≡\} is inside a group, so it doesn't affect the type style being used
elsewhere.
You can probably guess what ``{\≡\vskip 2.54 cm≡\}'' means; or aren't you ready
for the metric system yet? It turns out that 2.54 centimeters is exactly one inch.
The next line begins the straight text, which is what you will be typing most
of the time; don't be dismayed by the messy spacing instructions like {\≡\vskip≡\}
that you have been typing so far. Something messy like that is expected at the
beginning of a manuscript, but it doesn't last long. When \TEX\ begins to
read the words
$$\hbox{\≡Once upon a time, in a distant≡\}$$
it starts up a new paragraph. Now comes the good news, if you haven't used
computer typesetting before: You don't have to worry about where to break
lines in the paragraph, \TEX\ will do that for you. You can type long lines
or short lines, it doesn't matter; {\sl every time you hit $\langle\hbox
{carriage-return}\rangle$ it is essentially the same as typing a space}. When
\TEX\ has read the entire paragraph, it will try to break up the text so that
each line of output, except the last, contains about the same amount of copy; and it
will hyphenate words if necessary (but only as a last resort).
After you type in the next input line,
$$\hbox{\≡galaxy called \error \"O\"o\c c,≡\}$$
something new will happen: \TEX\ will type back an error message, saying
$$\vbox{\halign{#\hfill⊗#\hfill\cr
{\tt! Undefined control seque}⊗{\tt nce.}\cr
{\≡(*) galaxy called \error≡\}\cr
⊗{\≡\"O\"o\c c,≡\}\cr
{\≡↑≡\}\cr}}$$
What does this mean? It means, as you might guess, that an undefined control
sequence was found in the input. \TEX\ shows how far it has read your input
by displaying it in two lines; the first line shows what has been read before
the error was detected (namely ``{\≡galaxy≡char'40called≡char'40\error≡char'40≡\}'')
and the next line shows what \TEX\ hasn't looked at yet but will see next.
So it is plain that ``{\≡\error≡\}'' is the culprit; it is a control sequence
that hasn't been defined. After an error message, all is not lost, you have
several options:
\yskip(1) Type $\langle\hbox{line-feed}\rangle$.\xskip This will cause future
error messages to be printed on your terminal as usual, but \TEX\ will always
proceed immediately without waiting for your response. It is a fast, but
somewhat dangerous, way to proceed.
\yskip(2) Type ``{\tt x}'' or ``{\tt X}''.\xskip This will cause \TEX\ to stop right
then and there, but you will be able to print any pages that have been completed.
\yskip(3) Type ``{\tt e}'' or ``{\tt E}''.\xskip
This will terminate \TEX\ and activate
the system editor, allowing you to edit the input file that \TEX\ is
currently reading.\xskip(Don't do this unless there is such a file.)
\yskip(4) Type ``{\tt i}'' or ``{\tt I}''.\xskip This will cause \TEX\ to prompt you
(with ``{\tt*}'') for text to be {\sl inserted} at the current place
in the input; \TEX\ will go on to read this new text before looking at what it
ordinarily would have read next. You can often
use this option to fix up the error. For example, if
you have misspelled a control sequence, you can simply insert the correct
spelling.\xskip
(The $\langle$carriage-return$\rangle$ that you type after an insertion does not
count as a space in the inserted text.)
\yskip(5) Type $\langle\hbox{carriage-return}\rangle$. This is what you
should do now. It causes \TEX\ to resume its processing.
\yskip(6) Type a number ({\tt1} to {\tt9}). \TEX\ will delete this many tokens
from the input that it ordinarily would have read next,
and then it will come back asking you to choose one of these
options again.\xskip(A ``token'' is a single character or a control sequence. In
certain rare circumstances \TEX\ will not carry out the deletions, but you
probably will never run into such cases.)
\yskip(7) Type ``{\tt?}'' or anything else. Then \TEX\ will refresh your memory
about options (1) to (6), and will wait again for you to exercise one of
these options.
\yskip If you respond by $\langle\hbox{carriage-return}\rangle$ or
$\langle\hbox{line-feed}\rangle$ or ``{\tt i}'' or ``{\tt I}'', \TEX\ tries to
recover from the error as best it can before carrying on. For example,
\TEX\ simply ignores an undefined control sequence like {\≡\error≡\}. If the
error message is
$$\hbox{\≡! Missing } inserted.≡\}$$
\TEX\ has inserted a {\≡}≡\} which it has reason to believe was missing.
Chapter 27 discusses error
messages and appropriate recovery procedures in further detail.
OK, you were supposed to type this line containing an {\≡\error≡\} so that
you could experience the way \TEX\ sometimes complains at you. Similar
incidents will probably happen again, since \TEX\ is constantly on the
lookout for mistakes. The program tries to be a helpful and constructive
critic, to catch errors before they lead to catastrophes. But sometimes,
like all programs, it really doesn't understand what's going on, so you
have to humor it a bit.
On the remainder of the {\≡\error≡\} line you will note the strange concoction
$$\hbox{\≡\"O\"o\c c≡\}$$
and you already know that {\≡\"≡\} stands for an umlaut accent. The {\≡\c≡\}
stands for a ``cedilla'' accent, so you will get
$$\hbox{\"O\"o\c c}$$
as the name of that distant galaxy.
\yskip The next two lines are very simple, except that we haven't encountered
{\≡\par≡\} before. This is one of the ways to end a paragraph.\xskip
(Another way is to have a completely blank line. A third way is to come to
the end of a file-page in an input file.)
\yskip
The following lines of the example are also quite straightforward; they provide
a review of the conventions we discussed long ago for dashes and quotation marks.
But when you type ``{\≡\end≡\}'' in the position shown, you will get another error
message. The {\≡\end≡\} instruction is the normal way to stop \TEX, but it
has to occur at a proper time: not in mid-paragraph. The error message
you get this time is
$$\hbox{\tt ! You can't do that in horizontal mode.}$$
As we will see later, \TEX\ gets into various ``modes,'' and it is in
``horizontal mode'' when it is making a paragraph. If you try to do
something that is incompatible with the current mode, you will get this sort of
error message. The proper response here is, once again, to hit
$\langle\hbox{carriage-return}\rangle$; \TEX\ will resume and forget
that you said {\≡\end≡\} when you shouldn't.
\yskip The final line of the example says {\≡\par≡\} (to end the paragraph
and get you out of horizontal mode), then it says
$$\hbox{\≡\vfill≡\}$$
(which means vertical fill---it will insert as much space as necessary to fill
up the current page), then it says
$$\hbox{\≡\end≡\}$$
and now \TEX\ will end its processing gracefully. An ``{\tt xspool}'' command
will appear on your terminal; just hit $\langle\hbox{carriage-return}\rangle$
and the XGP will print your output.\xskip(At least, this is what will happen if
you are at Stanford using the WAITS system.)
The output corresponding to the above example will not
be shown in this manual; you'll have to do the experiment personally in
order to see what happens.
At this point you might also like to look at the file called {\tt ERRORS.TMP}
on your area, since it records the error messages that \TEX\ typed back at
you. Say ``{\tt type errors.tmp}'' to the operating system.
\yyskip \noindent\exno 6.1: If you had typed the second line of the story as
$$\hbox{\≡galaxy called \"O\"o\cc,≡\}$$
\TEX\ would have issued an error message saying that the control sequence {\≡\cc≡\}
is undefined. What is the best way to recover from this error?
\yyskip That was Experiment Number 1, and you're ready for Experiment
Num\-ber\penalty1000\
2\penalty0---after which you will be nearly ready to go on to the preparation of
large manuscripts.
For Experiment 2, {\sl prepare a file} called {\tt STORY.TEX} that contains
all the lines of the above example from ``{\≡\vskip 1 in≡\}'' to
``{\≡\par\vfill\end≡\}'' inclusive; but change the last line to
$$\hbox{\≡\par\vfill\eject≡\}$$
instead.\xskip(The {\≡\eject≡\} instruction is something like {\≡\end≡\}; it ends
a page, but not the whole job.)\xskip Note that the line that specifies {\≡\hsize≡\}
is to be omitted from your {\tt STORY} file; the reason is that we are going
to try typesetting the same story with a variety of column widths.
Start \TEX\ again ({\tt r tex}), and {\≡\input basic≡\} again. But now type
$$\vbox{\halign to size{\hskip 25pt #\hfill\cr
{\≡\hsize 4 in≡\}\cr
{\≡\input story≡\}\cr}}$$
and see what happens. Guess what: \TEX\ is now going to set 4-inch columns, and
it is going to read your {\tt STORY.TEX} file.
Again it is going to hiccup on the undefined control sequence {\≡\error≡\}. This
time try typing ``{\tt e}'', so you can see how to get right to the
system file editor from \TEX\ in case your file is messed up. Delete the
offending {\≡\error≡\} from the file, then start \TEX\ off from scratch again.
Now try typing several instructions on the same line:
$$\hbox to size{\hskip 25pt\≡\input basic\hsize 4in\input story≡\}$$
If you don't put a blank space after the {\tt c} of {\tt basic} here, you'll get
an error message (a file name should be followed by a blank space),
but in this case it's safe to hit $\langle\hbox{carriage-return}\rangle$ and
continue.\xskip
(\TEX\ is just warning you that something may have been amiss; the rule
is that a space should be there, but it will be inserted if you proceed. From
now on, always leave a space after file names, to avoid any hassle.)
Soon \TEX\ will be reading your {\tt story} file again---and it will hang up
on the {\≡\end≡\} error. Instead of removing this error, just type
$\langle\hbox{line-feed}\rangle$ since you know it is harmless to bypass
this error.
When \TEX\ asks for more input, type the following lines, one at a time:
$$\halign{\hskip 25pt#\cr
{\≡\hsize 3in \input story≡\}\cr
{\≡\hsize 1.5in \input story≡\}\cr
{\≡\jpar 1000 \input story≡\}\cr
{\≡\ragged 1000 \input story≡\}\cr
{\≡\hsize 1 in \input story≡\}\cr
{\≡\end≡\}\cr}$$
The results will be somewhat interesting, so try it!
If you have followed instructions, your output will consist of six pages;
the first page has MY STORY set 4 inches wide, the next has it set 3 inches wide,
then come three pages where it is set 1$1\over2$ inches wide, and a final
page where \TEX\ tries to make 1-inch columns. Since 1-inch columns of 10-point
type allow only about 15 characters per line, the last four pages
put quite a strain on \TEX's ability to break paragraphs up into
attractive lines.
When \TEX\ fails to find a good way to handle a paragraph,
there usually {\sl is} no good way (except that \TEX\ doesn't know how to
hyphenate all words). In such cases the symptom is that \TEX\ reports an
``overfull box,'' and lines that are too long will appear in the output.
You probably noticed such a complaint about overfull boxes when \TEX\ was
first trying to set the story with 1.5 inch columns.\xskip (If you didn't notice
it on your terminal, look at {\tt errors.tmp} to refresh your memory.) Several lines
on page 3 of your output will be more than 1.5
inches long---they are ``overfull'' and
stick out like sore thumbs.
There are two remedies for overfull boxes: You can either rewrite the
text of the manuscript to avoid the problem (in fact, careful authors
often do just that), or you can tell \TEX\ to consider larger spaces
acceptable. The instruction {\≡\jpar 1000≡\} essentially makes \TEX\
look for more ways to break the paragraph, including those with larger
spaces; so the fourth page of the output shows a solution of the problem
without any overfull boxes.
\danger The expandability of spaces is defined by the font, not by \TEX. Standard
\TEX\ fonts like cmr10 have fairly tight restrictions on spacing, in accordance
with the recommendations of contemporary typographers.
These strict standards are appropriate for books, but not for
newspapers, when more tolerance is needed. If you are setting a lot of
material with narrow margins, it would be better to use a font with more
variability in its spacing than to use a high setting of {\≡\jpar≡\},
since \TEX\ has to work harder when {\≡\jpar≡\} is large (it considers
more possibilities). Chapter 14 explains more about {\≡\jpar≡\}.
\danger The instruction {\≡\ragged 1000≡\} causes paragraphs
to be set with a ``ragged
right margin''---i.e., the lines are broken as usual, but spaces between words
don't stretch or shrink very much. Chapter 14 tells more about {\≡\ragged≡\}ness.
\danger When {\≡\hsize≡\} was one inch in the above experiment, \TEX\ again
came up with an overfull box, even when {\≡\jpar≡\} was quite large.
The reason is that \TEX\ doesn't know how to hyphenate ``Drofnats'', the
second word of the second paragraph. To remedy this, replace ``{\tt Drofnats}''
by ``{\≡Drof\-nats≡\}'' in both places where it occurs in your {\tt story} file,
and try setting the story with
$$\hbox{\≡\hsize 1 in \jpar 1000 \ragged 0≡\}\quad.$$
You'll see that the output is now quite reasonable, considering the extremely
narrow column width. The control sequence {\≡\-≡\} means a {\sl discretionary
hyphen}, namely a legal place to hyphenate the word if \TEX\ needs to.\enddanger
At this point you might want to play around with \TEX\ a bit before you read
further. Try different stories, different measurements, and so on. One
experiment particularly recommended is to type
$$\hbox{\≡\ctrline{MY \ERROR STORY}≡\}$$
after {\tt basic} has been {\≡\input≡\}. This produces a somewhat more elaborate
error message with which you should become acquainted, namely:
$$\vbox{\halign{#\cr
{\tt! Undefined control sequence.}\cr
{\≡<argument> MY \Error≡\}\cr
{\tt\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ STORY}\cr
{\≡... plus1000cm minus1000cm #1≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \hskip 0pt
plus1000cm minu...≡\}\cr
{\≡(*) \ctrline{MY \ERROR STORY}≡\}\cr}}$$
The reason for all this is that {\≡\ctrline≡\} is not a built-in \TEX\
instruction, it is a control sequence defined in the {\tt basic} format. Thus
\TEX\ did not detect any mistake when it read ``{\≡{MY \ERROR STORY}≡\}'',
it simply absorbed this group and passed the text ``{\≡MY \ERROR STORY≡\}'' as
an argument to the {\≡\ctrline≡\} definition. According to Appendix B,
{\≡\ctrline≡\} gets expanded into the text
$$\vbox{\halign{#\cr
{\≡\hbox to size{\hskip0pt plus1000cm minus1000cm≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ #1\hskip0pt plus1000cm minus1000cm}≡\}\cr}}$$
where the argument gets inserted in place of the ``{\≡#1≡\}''.\xskip (You don't
have to understand exactly what this means, just believe that it is a way to
center something on a line.)\xskip A fragment of this expansion is shown in the
error message, preceded and followed by ``{\tt...}'' to indicate that there
was more to the expansion \TEX\ was reading. The error message shows that
\TEX\ had read the expansion up to the point ``{\≡#1≡\}'', because {\≡\hskip≡\}
etc$.$ appears on the next line. Furthermore the error message shows that \TEX\
was reading the argument, and the last thing it read was the control sequence
``{\≡\Error≡\}''.\xskip (You actually typed ``{\≡\ERROR≡\}'',
but upper case and lower case
are not distinguished by \TEX\ after the first letter of a control sequence.)
The point is that when you make an error within a routine controlled by a
defined control sequence like {\≡\ctrline≡\}, the error message will show
everything \TEX\ knows about what it was reading; the display occurs in
groups of two lines per level of reading, where the first line shows what
\TEX\ has read at this level and the second line shows what is yet to be read.
Somewhere in there you should be able to spot the problem, the thing \TEX\
wasn't expecting.
\danger Careful study of the 1.5-inch example shows that \TEX\
does not automatically break lines just before a dash, although it does do so
just {\sl after} one. Some printers will start new lines with dashes; if you
really want to do this you can type ``{\≡\penalty 0≡\}'' just before each
dash. For example, ``{\≡Drofnats\penalty 0---≡\}''.\enddanger
\chapterbegin 7. {How \TEX\ reads what you type}
While studying the example in the previous chapter, we observed that an input
manuscript is expressed in terms of ``lines'' ending with $\langle
$carriage-return$\rangle$s, but these lines of input are essentially independent
of the lines of output that will appear on the finished pages. Thus you
can stop typing a line of input at any convenient place. A few other related rules
have also been mentioned:
\yskip $\bullet$ A $\langle\hbox{carriage-return}\rangle$ is like a space.
\yskip $\bullet$ Two spaces in a row count as one space.
\yskip $\bullet$ A blank line denotes end of paragraph.
\yskip \noindent Strictly speaking, these rules are contradictory: A blank line
is obtained by typing $\langle\hbox{carriage-return}\rangle$ twice in a row,
and this is different from typing two spaces in a row. So now let's see what
the {\sl real} rules are. The purpose of this chapter is to study the very
first stage in the transition from input to output.
\yskip In the first place, it's wise to have a precise idea of what your keyboard
sends to the machine. There are 128 characters that \TEX\ might encounter at
each step in a file or in a line of text typed directly on your terminal. These
128 characters are classified into 13 categories numbered 0 to 12:
$$\vbox{\halign{\hfill#\hfill⊗ # \hfill⊗#\hfill\cr
Category code⊗\hfill Meaning\cr
\noalign{\vskip 3pt}
\90⊗Escape character⊗({\≡\≡\} in this manual)\cr
\91⊗Beginning of group⊗({\≡{≡\} in this manual)\cr
\92⊗End of group⊗({\≡}≡\} in this manual)\cr
\93⊗Begin or end math⊗({\≡$≡\} in this manual)\cr
\94⊗Alignment tab⊗({\≡⊗≡\} in this manual)\cr
\95⊗End of line⊗($\langle$carriage-return$\rangle$ and {\≡%≡\} in this manual)\cr
\96⊗Parameter⊗({\≡#≡\} in this manual)\cr
\97⊗Superscript⊗({\≡↑≡\} in this manual)\cr
\98⊗Subscript⊗({\≡≡↓≡\} in this manual)\cr
\99⊗Ignored character\cr
10⊗Space\cr
11⊗Letter⊗({\tt A}, $\ldotss$, {\tt Z} and {\tt a}, $\ldotss$, {\tt z})\cr
12⊗Other character\cr}}$$
It's not necessary for you to learn these code numbers; the point is only that
\TEX\ responds to 13 different types of characters. At first this manual led
you to believe that there were just two types---the escape character and the
others---and more recently you were told about two more types, the grouping
symbols like {\≡{≡\} and {\≡}≡\}. Now you know that there are really 13. This
is the whole truth of the matter; no more types remain to be revealed.
Actually
no characters are defined to be of types 0 to 8 when \TEX\ begins, except that
$\langle$carriage-return$\rangle$ and $\langle$form-feed$\rangle$ are type
5. But if you
are using a predefined format (like almost everybody does) you will be told which
characters have special significance. For example, if you are using the
{\tt basic} package of Appendix B you need to know that the nine characters
$$\hbox{\≡\≡ ≡ {≡ ≡ }≡ ≡ $≡ ≡ ⊗≡ ≡ %≡ ≡ #≡ ≡ ↑≡ ≡ ≡↓≡\}$$
cannot be used as ordinary characters in your text; they have special meaning.\xskip
(If you really need any of these symbols as part of what you're typing, e.g., if
you need a {\≡$≡\} to represent dollars, there is a way out---this will
be explained later. A list of control sequences for special symbols appears in
Appendix F.)
\yskip When \TEX\ is reading a line of text from a file, or a line of text that
you entered directly on your terminal, it is in one of three ``states'':
$$\vbox{\halign{State $#$\qquad\hfill⊗#\hfill\cr
N⊗Beginning a new line\cr
M⊗Middle of a line\cr
S⊗Skipping blanks\cr}}$$
At the beginning it's in state $N$, but most of the time it's in state $M$,
and after a control sequence or a space it's in state $S$. Incidentally, ``states''
are different from the ``modes'' mentioned in Chapter 6; the current {\sl state}
refers to \TEX's eyes and mouth as they take in characters of new text, but
the current {\sl mode} refers to the condition of \TEX's gastro-intestinal
tract. Modes are discussed further in Chapter 13.
You hardly ever need to worry about what state \TEX\ is in, but you may want
to understand the rules just in case \TEX\ does something unexpected to your
input file. In general, it is nice to understand who you are talking to.
Furthermore, if you faithfully carried out the experiment in the previous
chapter you will probably have noticed that there was an unwanted space after
the dash in ``{\tt called---}''; the $\langle$carriage-return$\rangle$
after this dash got
changed into a space that doesn't belong there. This error was purposely put
into the example because the author of this manual feels that we learn best
by making mistakes. But now let's look closely into \TEX's reading rules so
that such mistakes will be unlearned in the future.
Fortunately the rules are not complicated or surprising; you could probably
write them down yourself:
\yyskip\noindent If in state $N$ (new line) and \TEX\ sees
\yskip\hang\textindent{a)}an escape character (type 0), \TEX\ scans the entire
control sequence, then digests it (i.e., sends the control sequence to the
guts of \TEX\ where it will be processed appropriately) and goes to state $S$.
\yskip\hang\textindent{b)}an end-of-line character (type 5), \TEX\ throws away
any other information that might remain on the current line, then digests a
``{\≡\par≡\}'' instruction (paragraph end) and remains in state $N$.
\yskip\hang\textindent{c)}an ignored character or a space (types 9,10), \TEX\
passes it by, remaining in state $N$.
\yskip\hang\textindent{d)}anything else (types 1,2,3,4,6,7,8,11,12), \TEX\
digests it and goes to state $M$.
\yskip\noindent In summary, when \TEX\ is beginning a line, it skips blanks,
and if it gets to the end of the line without seeing anything it considers
that a paragraph has ended.
\yyskip\noindent If in state $M$ (middle of line) and \TEX\ sees
\yskip\hang\textindent{a)}an escape character (type 0), \TEX\ scans the entire
control sequence, then digests it and goes to state $S$.
\yskip\hang\textindent{b)}an end-of-line character (type 5), \TEX\ throws away
any other information that might remain on the current line, then digests a
blank space and goes to state $N$.
\yskip\hang\textindent{c)}an ignored character (type 9), \TEX\ passes it by,
remaining in state $M$.
\yskip\hang\textindent{d)}a space (type 10), \TEX\ digests a blank space
and goes to state $S$.
\yskip\hang\textindent{e)}anything else (types 1,2,3,4,6,7,8,11,12), \TEX\
digests it and remains in state $M$.
\yskip\noindent In summary, when \TEX\ is in the middle of a line, it digests
what it sees, but converts one or more blank spaces into a single blank space,
and also treats the end of line as a blank space.
\yyskip\noindent If in state $S$ (skipping blanks) and \TEX\ sees
\yskip\hang\textindent{a)}an escape character (type 0), \TEX\ scans the entire
control sequence, then digests it, remaining in state $S$.
\yskip\hang\textindent{b)}an end-of-line character (type 5), \TEX\ throws away
any other information that might remain on the current line, then switches to
state $N$.
\yskip\hang\textindent{c)}an ignored character or a space (types 9,10), \TEX\
passes it by, remaining in state $S$.
\yskip\hang\textindent{d)}anything else (types 1,2,3,4,6,7,8,11,12), \TEX\
digests it and goes to state $M$.
\yskip\noindent In summary, when \TEX\ is skipping blanks, it ignores blanks
and doesn't treat the end of a line as a blank space.
\yyskip So those are the rules. Only three major consequences deserve special
emphasis here:
First, a $\langle\hbox{carriage-return}\rangle$
always counts as a space, even when it
follows a hyphen. If you want to end a line with a $\langle\hbox
{carriage-return}\rangle$ but no space,
you can do this by typing the control sequence ``{\≡\!≡\}'' just before the
$\langle\hbox{carriage-return}\rangle$.
For example, the 7th-last line
of MY STORY in Chapter 6 should really have been typed as follows:
$$\hbox{\≡he preferred to be called---\!≡\}$$
A second consequence of the rules, if you are using the {\tt basic} format of
Appendix B, is that the {\≡%≡\} sign is treated as an end-of-line mark
equivalent to a $\langle\hbox{carriage-return}\rangle$. This is useful for
putting comments into the manuscript. For example, you might include a
copyright notice for legal protection; or you might say
$$\hbox to size{\hskip 25pt\≡% Figure 5 belongs here;≡\}$$
or you might say
$$\hbox to size{\hskip 25pt\≡% This } is supposed to match the { of "\ctrline{".≡\}
$$Anything that you might want to remember but not to print can be included after
a {\≡%≡\}, because \TEX\ will never look at the rest of the line.
A third consequence of the rules is that you should indicate
the end of a paragraph either explicitly, by using the
control sequence {\≡\par≡\}; or implicitly, by having an
entirely blank line.\xskip
(The end of a file page also counts as a blank line, because of
the way files of text are conventionally represented in the computer.) In the
latter case, \TEX\ has always read a space before it came to the end of the
paragraph, because it digested a space at the end of the line before the
blank line. In the former case, you may or may not have typed a space before you
typed ``{\≡\par≡\}''. Fortunately, there's nothing to worry about; the result
is the same in either case, because \TEX's paragraph processor discards the
final item of a paragraph when it is a space.
If you have several blank lines in a row, \TEX\ digests a ``{\≡\par≡\}''
instruction for each one, according to the rules. But this doesn't show up
in the output, because empty paragraphs are discarded.
\yskip
\noindent\exno 7.1: If a line isn't entirely blank, but the first nonblank character
on the line is {\≡%≡\}, does this signify end-of-paragraph?
\danger When \TEX\ first starts up, the 128 possible characters are initially
interpreted as follows. Characters ``{\tt A}'' to ``{\tt Z}'' (ascii codes
\char'16 101 to \char'16 132) and ``{\tt a}'' to ``{\tt z}'' (ascii codes
\char'16 141 to \char'16 172) are type 11 (letters). The characters
$\langle$null$\rangle$, $\langle\hbox{line-feed}\rangle$, $\langle\hbox
{vertical-tab}\rangle$, $\langle\hbox{alt-mode}\rangle$, and $\langle\hbox
{delete}\rangle$ (ascii codes 0, \char'16 12, \char'16 13, \char'16 175, and
\char'16 177 at Stanford) are type 9 (ignored). The characters
$\langle$tab$\rangle$ and $\langle$ $\rangle$ (ascii codes \char'16 11 and
\char'16 40) are type 10 (spaces). The characters $\langle\hbox{form-feed}
\rangle$ and $\langle\hbox{carriage-return}\rangle$ (ascii codes \char'16 14 and
\char'16 15) are type 5 (end of line). All other characters are type 12 (other).
The first non-space input by \TEX\ is defined to be the escape character used
in error messages, and it is set to type 0 (escape). You can use {\≡\chcode≡\}
to change the type code of any character, and it is possible to have several
characters each defined to be of type 0 or any other type. The instruction
$$\hbox{{\≡\chcode≡\}$\langle\hbox{number}↓1\rangle\hbox{\tt←}\langle
\hbox{number}↓2\rangle$}$$
(where $\langle\hbox{number}↓1\rangle$ is between 0 and 127 and
$\langle\hbox{number}↓2\rangle$ is between 0 and 12)
causes the character whose 7-bit code is $\langle\hbox{number}↓1\rangle$
to be regarded as type $\langle\hbox{number}↓2\rangle$ for the duration of the
current group, unless its type is changed again by another {\≡\chcode≡\}. For
example, if for some reason you want \TEX\ to treat the letter ``{\tt a}'' as
a non-letter, you could say
$$\hbox{\≡\chcode≡'141←12≡\}\quad.$$
But this would probably not be useful because, e.g., ``{\≡\par≡\}'' would no longer
be a control sequence; it would be read as ``{\≡\p≡\}'' followed by ``{\tt a}''
followed by ``{\tt r}''.\enddanger
We will see later that spaces are sometimes ignored after {\sl other} things
besides control sequences, since there are various \TEX\ constructions that
look better if spaces or end-of-line follow them. For convenient reference,
here is a list of all cases in which \TEX\ will ignore a space, even though
most of these constructions haven't been explained yet in the manual:
\def\¬{\yskip\hangindent 40pt $\bullet$ }
\¬ After a space or end-of-line character.
\¬ After a control sequence.
\¬ After the {\≡}≡\} that ends a {\≡\def≡\} or {\≡\if≡\}
or {\≡\ifeven≡\} or {\≡\else≡\} or {\≡\noalign≡\} or {\≡\output≡\} or {\≡\mark≡\}.
\¬ Between {\≡$≡\} signs, when \TEX\ is in math mode.
\¬ After the {\≡$$≡\} that ends a display.
\¬ After a file name or an already-defined font code or a
unit of measure or the words ``{\tt to}'' or ``{\tt par}'' or ``{\tt size}'' in box
specifications.
\¬ Before or after a $\langle$number$\rangle$ or the sign
preceding a $\langle$number$\rangle$.
\¬ After a paragraph, or in general whenever \TEX\ is in
vertical mode or restricted vertical mode.
\danger \TEX\ goes into reading state $S$ only as shown in the detailed reading
rules above. When it ignores spaces at other times, e.g$.$ after a unit of measure,
the spaces it ignores are actually ``digested'' spaces; the processing routine
calls on \TEX's input mechanism to continue reading until a non-space is digested.
This is a fine point, because it hardly ever makes a difference; but here is
a case where it matters: Suppose you make the definition
``{\≡\def\space{≡char'40}≡\}''. Then if you type ``{\≡\space\space≡\}'',
\TEX\ will digest
two spaces; these spaces would not be ignored after a space or end of line or
control sequence, because of \TEX's reading rules, but they would be ignored
in the other cases listed above, because of \TEX's digestive processes. On the
other hand {\≡\≡char'40≡\} (control space) is treated differently: it always
means an explicit space and it is never ignored in any of the above cases
except the last (in vertical mode). Sometimes \TEX\ will ignore only
one digested space, but at other times it will ignore as many as are fed to it;
if you really need to know which cases fall into each category, you can find
out by experiment.\enddanger
\chapterbegin 8. {The characters you type}
A lot of different keyboards are used with \TEX, but few keyboards can
produce 128 different symbols. Furthermore, as we have seen, some of the
characters that you {\sl can} type on your keyboard are reserved for
special purposes like escaping and grouping. Yet when we studied fonts it
was pointed out that there are 128 characters per font. So how can you refer to the
characters that aren't on your keyboard, or that have been pre-empted
for formatting?
One answer is to use control sequences. For example, the {\tt basic} format
of Appendix B, which defines {\≡%≡\} to be an end-of-line symbol so that you
can use it for comments, also defines the control sequence {\≡\%≡\} to mean
a per-cent sign.
To get access to any character whatsoever, you can type
$$\hbox{{\≡\char≡\}$\langle$number$\rangle$}$$
where $\langle$number$\rangle$ is any number from 0 to 127 (optionally followed
by a space), and you will get the corresponding character from the current font.
For example, the letter ``{\tt b}'' is character number 98, so you could
typeset the word {\tt bubble} by typing
$$\hbox{\≡\char98u\char98\char98le≡\}$$
if the {\tt b}-key on your typewriter is out of order.\xskip(Of course you need the
{\≡\≡\}, {\tt c}, {\tt h}, {\tt a}, and {\tt r} keys to type ``{\≡\char≡\}'',
so let's hope they are always working.)
Character numbers are usually given in {\sl octal notation} in reference books
(i.e., using the radix-8 number system). A $\langle$number$\rangle$ in \TEX's
language can be preceded by a {\≡≡'≡\}, in which case it is understood as octal.
For example, the octal code for ``{\tt b}'' is {\it 142\/}\footnote*{The
author of this manual likes to use italic digits to denote octal numbers,
instead of using the \char'16\ symbol, when octal numbers appear in printed books.},
so$$\hbox{\≡\char≡'142≡\}$$
is equivalent to {\≡\char98≡\}. In octal notation, character numbers run from
{\≡≡'0≡\} to {\≡≡'177≡\}.
\danger Formally speaking, a $\langle$number$\rangle$ in a \TEX\ manuscript
is any number of spaces followed by an optional ``\char'16'' followed by any number
of digits followed by an optional space. Or it can be any number of spaces followed
by ``{\≡\count≡\}$\langle$digit$\rangle$'' followed by an optional space; in the
latter case the specified counter is used (cf.\ Chapter 23).\enddanger
You can't use {\≡\char≡\} in the middle of a control sequence, though. If you type
$$\hbox{\≡\\char≡'142≡\}$$
\TEX\ reads this as the control sequence {\≡\\≡\} followed by {\tt c}, {\tt h},
{\tt a}, etc., not as the control sequence {\≡\b≡\}.
Actually you will hardly ever have to use {\≡\char≡\} yourself, since the characters
you want will probably be available as predefined control sequences; {\≡\char≡\}
is just a last resort in case you really need it (and it is also indispensible for
the designers of book formats).
Since \TEX\ is intended to be useful on many different kinds of keyboards, it
does not assume that you can type very many of the exotic characters. For example,
if your keyboard has an $\alpha$ on it (Greek lower case alpha)---this is
character code 2 at Stanford---you will be able to type ``$α$'' in a math formula
and get an alpha. But if you don't have $α$ on your keyboard, \TEX\ understands
the control sequence {\≡\alpha≡\} just as well.
Character code 2 in \TEX's font cmr10 is not really an alpha; it is
actually \char2, an upper case Greek theta! \TEX\ doesn't want you to type
``$α$'' except in math formulas. When you are typing straight text with \TEX's
special fonts like cmr10, you should confine yourself to the symbols usually
found on a typewriter and a few more that are listed in the next chapter.
In fact, {\sl every font you use might have a different way
of assigning its symbols to the numbers 0 to 127}. Whoever designed the
font should tell you what this encoding is. It's not even guaranteed that an
``{\tt a}'' will yield an ``a''. Your keyboard converts what you type into
codes between 0 and 127, and these codes will select the corresponding
characters of the current font, but a font designer can put whatever
symbol he or she wants into each position.
Furthermore, {\sl different fonts might also have different ligatures}. It
isn't true that {\tt--} will give you a dash in all fonts with \TEX, nor
that {\≡≡`≡`≡\} will become ``, nor that {\tt ffl} will become ffl. Each
font designer decides what ligature combinations will appear in his or her font,
and this person should tell you what they are. The seven ligatures
$$\hbox{\≡≡`≡`≡ ≡ ≡'≡'≡ ≡ --≡ ≡ ---≡ ≡ ff≡ ≡ fi≡ ≡ fl≡ ≡ ffi≡ ≡ ffl≡\}$$
described in Chapter 2 are available in all the ``standard'' \TEX\
roman and slanted fonts, but you should not assume that they are present in all
fonts.
Similarly, accents like {\≡\≡'≡\} and {\≡\"≡\} can't be used with all fonts;
the accent characters have to be in certain positions within the font, and
not all fonts have them.
\danger If you want to use an accent on a nonstandard font (e.g., if you need
a new accent for some newly discovered
African dialect), suppose you have a font that
includes this accent as character number \char'16 20. Then you can type
``{\≡\accent≡'20a≡\}'' to get this accent over an ``a'', etc. In general, type
$$\hbox{{\≡\accent≡\}$\langle$number$\rangle\langle$char$\rangle$}$$ to get an
accent over a character in the same font, or $$\hbox{{\≡\accent≡\}$\langle$number$
\rangle${\≡\:≡\}$\langle$font$\rangle\langle$char$\rangle$}$$
to get an accent over a character
in a different font. You're not allowed to say things like
``{\≡{\:b\accent'20}a≡\}'', however; the character to be accented must
immediately follow the accent except for font changes.\enddanger
\chapterbegin 9. {\TEX's standard roman fonts}
When you are using a standard roman font (like cmr10, cmb10, cms10, or cmss10,
which stand respectively for Computer Modern Roman, Bold, Slanted, or
Sans-Serif, 10 points high), you need to know the information in this chapter.
These fonts are intended to contain nearly every symbol you will need for
non-math text, including accents and special characters for use with foreign
languages. When you are using such fonts you should confine yourself to typing
the following symbols only:
\yskip the letters {\tt A} to {\tt Z} and {\tt a} to {\tt z}
\yskip the digits {\tt 0} to {\tt 9}
\yskip the standard punctuation marks {\≡, : ; ! ? ( ) [ ] & ≡`≡ ≡'≡ - * / .≡\}
\yskip\noindent You can also type{\tt\ + = < > }and you will get the corresponding
symbols, but this is not recommended because these symbols should be used only
in mathematics mode (explained later). The result will look better in
mathematics mode, because \TEX\ will insert proper spacing. When you use the
``{\tt-}'' and ``{\tt/}'' it should not be for mathematics; do hyphens and slashes
outside of math mode, but don't do subtractions and divisions.
\penalty-100 % Good place for page break
Conspicuously absent from this list are the following symbols found on many
keyboards:
$$\hbox{\≡\ { } # $ % ↑ ≡↓≡ " @≡\}$$
Resist the temptation to type them. Also resist the temptation to type mathematical
symbols like
$$\hbox{$|$\quad$←$\quad$α\quadβ\quadε\quadλ\quadπ\quad∀\quad∃\quad∞$}$$
and so on, if your keyboard has them. Like {\tt+} and {\tt=},
they should be reserved for
mathematics mode; but unlike {\tt+} and {\tt=},
they don't give the results you might expect,
except in mathematics mode.
By using control sequences you can obtain the following special symbols needed
in foreign languages:
$$\vbox{\halign{#\hfill\quad⊗\hfill#\hfill⊗#\hfill\cr
Type⊗to get\cr
\noalign{\vskip 3pt}
{\≡\ss≡\}⊗\ss⊗(German letter ss)\cr
{\≡\ae≡\}⊗\ae⊗(Latin and Scandinavian ligature ae)\cr
{\≡\AE≡\}⊗\AE⊗(Latin and Scandinavian ligature AE)\cr
{\≡\oe≡\}⊗\oe⊗(French ligature oe)\cr
{\≡\OE≡\}⊗\OE⊗(French ligature OE)\cr
{\≡\o≡\}⊗\o⊗(Scandinavian slashed o)\cr
{\≡\O≡\}⊗\O⊗(Scandinavian slashed O)\cr}}$$
For example, if you want to specify ``\AE sop's \OE uvres en fran\c cais'' you
could type
$$\hbox{\≡\AE sop≡'s \OE uvres en fran\c cais≡\}\quad.$$
(Note the spaces after these control sequences. Another way to separate them
from the surrounding text would be
$$\hbox{\≡{\AE}sop≡'s {\OE}uvres en fran{\c c}ais≡\}\quad;$$
this looks a little nicer, perhaps, in the computer file, but it's harder to type.)
The following accents are available in standard roman fonts, shown here with
the letter ``o'':
$$\vbox{\halign{#\hfill\quad⊗\hfill#\hfill⊗#\hfill\cr
Type⊗to get\cr
\noalign{\vskip 3pt}
{\≡\≡`o≡\}⊗\`o⊗(accent grave)\cr
{\≡\≡'o≡\}⊗\'o⊗(accent aigu, acute accent)\cr
{\≡\A o≡\}⊗\A o⊗(accent circonflexe, circumflex or ``hat'' accent)\cr
{\≡\v o≡\}⊗\v o⊗(Slavic h\'a\v cek accent, inverted circumflex)\cr
{\≡\u o≡\}⊗\u o⊗(breve, short vowel)\cr
{\≡\=o≡\}⊗\=o⊗(macron or bar, long vowel)\cr
{\≡\"o≡\}⊗\"o⊗(umlaut or double dot)\cr
{\≡\H o≡\}⊗\H o⊗(long Hungarian umlaut)\cr
{\≡\b o≡\}⊗\b o⊗(vector accent---used in mathematics)\cr
{\≡\s o≡\}⊗\s o⊗(tilde or squiggle)\cr
{\≡\t oo ≡\}⊗\t oo⊗(ties two letters together)\cr
{\≡\a a≡\}⊗\a a⊗(Scandinavian a with circle)\cr
{\≡\l l≡\}⊗\l l⊗(Polish crossed l)\cr
{\≡\c c≡\}⊗\c c⊗(cedilla accent)\cr}}$$
The last three of these examples are shown with other letters instead of ``o''
because they are somewhat special; the Scandinavian accent is shown over an ``a''
since ``\a o'' isn't a Scandinavian letter. Similarly, the {\≡\l≡\} accent is
specifically designed for the letter ``l''. Cedillas are usually associated
with the letter ``c'' (although it is true that ``\c o'' appears in Navajo).
Spaces are obligatory where shown in these examples. But the space can be
omitted after the accent codes {\≡\≡`≡\}, {\≡\≡'≡\}, {\≡\=≡\}, and
{\≡\"≡\}, since they don't involve letters.
Within a font, accents are designed to appear at the right height for letters
like ``o''; but \TEX\ will raise an accent if it is applied to a tall letter.
For example, the result of ``{\≡\"O≡\}'' is ``\"O''.
This simple rule almost always works
all right, but sometimes it fails; for example, an
upper case A with the circle accent traditionally has the circle touching the
A (\spose{\raise 1.667pt\hbox{\char'27}}A),
at least in Scandinavian books,
while ``{\≡\a A≡\}'' yields ``\a A''.\xskip (Both of these forms are used
by modern American printers to denote angstrom units, but
\spose{\raise 1.667pt\hbox{\char'27}}A is preferable.)\xskip
The {\≡\l≡\} doesn't work with a capital L either; ``{\≡\l L≡\}'' yields ``\l L''.
An even more conspicuous failure of \TEX's rule occurs
if you try to put a cedilla on an upper case ``C'' by typing ``{\≡\c C≡\}''; \TEX\
will raise the cedilla to give ``\c C''!\xskip (See below for how to handle these
anomalous cases.)
When the letters ``i'' and ``j'' are accented, it is traditional to omit the
dots they contain. Therefore standard roman fonts contain the dotless letters
$$\hbox{\i\quad and\quad\j}$$
which you can obtain by typing ``{\≡\i≡\}'' and ``{\≡\j≡\}'', respectively.
For example, to obtain ``m\=\i n\u us''
you would type ``{\≡m\=\i n\u us≡\}''.
\yyskip\noindent\exno 9.1: Explain what to type in order to get the
sentence
$$\hbox{{\sl Commentarii Academ\ae\ Petropolitan\ae} is now {\sl Doklady
Akademi\t\i a Nauk SSSR}.}$$
\exno 9.2: How would you specify the names \O ystein Ore, \t IUri \t IAnov,
Ja`far al-Khow\A arizm\A\i, and
W\l ladyis\l law S\"u\ss man?
\danger The character to be accented must immediately follow the accent,
except for the fact that
you are allowed to change fonts in between; see the remarks at
the close of the previous chapter. \TEX\ adjusts for the slantedness of
characters when placing accents, including the possibility that the
accent comes from a font with a different slant than the character being
accented. For example, if you type
$$\hbox{\≡\≡'e \≡'E \sl\≡'e \≡'E \rm\≡'\sl e \rm\≡'\sl E \≡'\rm e
\sl\≡'\rm E≡\}$$
using {\tt basic} format, the result will be
$$\hbox{\tenpoint
\'e \'E \sl\'e \'E \rm\'\sl e \rm\'\sl E \'\rm e \sl\'\rm E.}$$
\vskip-6pt
\danger The fonts are designed so that the anomalous cases of ``bad accents''
mentioned above can be handled as follows, using the {\≡\spose≡\} (superpose)
control sequence of {\tt basic} format: To get
$$\hbox{\tenpoint
\spose{\raise 1.667pt\hbox{\char'27}}A\quad
\spose{\char'30}C\quad
\spose{\raise 2.5pt\hbox{\char'31}}L}$$
type respectively
$$\vbox{\halign{#\cr
{\≡\spose{\raise 1.667pt\hbox{\char'27}}A≡\}\cr
{\≡\spose{\char'30}C≡\}\cr
{\≡\spose{\raise 2.5pt\hbox{\char'31}}L≡\}\cr}}$$
(This is for 10-point sizes; the amounts to raise the accents must be
adjusted proportionately when working with other sizes. For example,
``{\≡\raise 1.667pt≡\}'' would become ``{\≡\raise 1.5pt≡\}'' in 9-point
type.)\enddanger
A complete list of the 128 symbols in \TEX's standard roman fonts appears in
Appendix F. But everything a typist needs to know about them has already
been explained; it's not necessary for you to know the numeric character codes.
\chapterbegin 10. {Dimensions}
The example program used in the trial runs of Chapter 6 involved mysterious
\TEX\ instructions like ``{\≡\vskip 2.54cm≡\}''. Now it is time to reveal part of
this mystery, by explaining what units of measure \TEX\ understands.
``Points'' and ``picas'' are printers' traditional basic units of measure, so \TEX\
understands points and picas. \TEX\ also understands inches and certain
metric units, but it converts everything internally to points. Each unit of
measure is given a two-letter abbreviation; here is a complete list of
the units \TEX\ knows about:
$$\vbox{\halign{\tt#\quad⊗#\hfill\cr
pt⊗point\cr
pc⊗pica (one pica equals 12 points)\cr
in⊗inch (one point equals 0.01383700 inches)\cr
cm⊗centimeter (one inch equals 2.5400 centimeters)\cr
mm⊗millimeter (one centimeter equals 10 millimeters)\cr
dd⊗Didot point (one centimeter equals 26.600 Didot points)\cr
em⊗One ``quad'' of space in the current font (see Chapter 18)\cr}}$$
When you want to express some physical dimension to \TEX, type it as
$$\hbox{$\langle$optional sign$\rangle\langle$number$\rangle\langle$unit
of measure$\rangle$}$$
or
$$\hbox{$\langle$optional sign$\rangle\langle$number$\rangle\hbox{\tt.}
\langle$number$\rangle\langle$unit of measure$\rangle$}$$
(and in the second case your $\langle$number$\rangle$s had better not be
in octal notation or \TEX\ will get confused). An $\langle$optional
sign$\rangle$ is either a ``{\tt+}'' or a ``{\tt-}'' or nothing at all.
For example, here are some typical lengths:
$$\vbox{\halign{\tt#\hfill\cr
3 in\cr
29 pc\cr
-0.013837in\cr
+ 42.1 dd\cr
0 mm\cr}}$$
A plus sign is redundant, but some people like occasional redundancy.
\penalty-200 % Good place to break the page
Spaces are optional before and after numbers and after the units of measure,
but you should not put spaces {\sl within} a number or between the two
letters in the unit of measure.
In a manual like this it is convenient to use ``angle brackets'' in abbreviations
for various constructions like $\langle$number$\rangle$ and $\langle$optional
sign$\rangle$. Henceforth
in this manual we will use the term $\langle$dimen$\rangle$ to stand for
any dimension expressed in the above form. For example,
$$\hbox{{\≡\hsize≡\}$\langle$dimen$\rangle$}$$
will be the general way to define the page width \TEX\ is supposed to use.
When a dimension is zero, you have to specify a unit of measure even though it
is redundant. Don't just say ``{\tt0}'', say ``{\tt0pt}'' or ``{\tt0in}'' or
something.
\danger Chapter 6 mentions that units of measure may be inflated artificially on
some output devices. The following ``rulers'' have been typeset by \TEX\
so that you can calibrate the output device used to produce the copy of
the manual you are reading:
$$\vbox{
\def\1{\vrule height 0pt depth 2pt}
\def\2{\vrule height 0pt depth 4pt}
\def\3{\vrule height 0pt depth 6pt}
\def\4{\vrule height 0pt depth 8pt}
\def\ruler#1#2{\hbox{$\vcenter{\hrule\hbox{\4#1}}$ #2}}
\def\\#1{\hbox to .125in{\hfill#1}}
\def\8{\\\1\\\2\\\1\\\3\\\1\\\2\\\1\\\4}
\ruler{\8\8\8\8}{4 in}
\vskip 12pt
\def\\#1{\hbox to 10pt{\hfill#1}}
\def\8{\\\1\\\1\\\1\\\1\\\2\\\1\\\1\\\1\\\1\\\4}
\ruler{\8\8\8}{300 pt}
\vskip 12pt
\def\\#1{\hbox to 5mm{\hfill#1}}
\def\8{\\\2\\\4} % I couldn't do millimeters with our XGP server
\ruler{\8\8\8\8\8\8\8\8\8\8}{10 cm}
\vskip 6pt}$$
\exno 10.1: (To be worked after you know about boxes and glue and have read
Chapter 21.)\xskip Explain
how to typeset a 10 cm ruler like this using \TEX.\enddanger
\chapterbegin 11. {Boxes}
$\TEX$ makes complicated pages by starting with simple individual characters
and putting them together in larger units, and putting these together in still
larger units, and so on. Conceptually, it's a big paste-up job. The \TEX nical
terms used to describe such page construction are {\sl boxes} and {\sl glue}.
Boxes in \TEX\ are two-dimensional things with a rectangular shape, having
three associated measurements called {\sl height}, {\sl width}, and {\sl depth}.
Here is a picture of a typical box, showing its so-called reference point and
baseline:
\figure{96pt}{(A figure will be inserted here, too bad you can't see it now.)}
From \TEX's viewpoint, a single character from a font is a box, one of the
simplest kinds of boxes. The font designer has decided what the height, width,
and depth of the character are, and what the symbol will look like when it
is in the box; \TEX\ just uses these dimensions to paste boxes together, and
ultimately to determine the locations of the reference points for all
characters on a page. In the cmr10 font, for example, the letter ``h'' has a
height of 6.9444 points, a width of 5.5556 points, and a depth of zero; the
letter ``g'' has a height of 4.4444 points, a width of 5 points, and a depth of
1.9444 points. Only certain special characters like parentheses have height plus
depth
actually equal to 10 points, although cmr10 is said to be a ``10 point'' font.
The typist doesn't have to know these measurements, of course,
but it is helpful for \TEX's users to be aware of the sort of information
\TEX\ deals with.
The character shape need not fit inside the boundaries of the box. For example,
some characters that are used to build up larger symbols like square-root signs
intentionally protrude a little bit, so that they overlap properly with the
rest of the symbol. Slanted letters frequently extend a little to the right
of the box, as if the box were skewed right at the top and left at the bottom,
keeping its baseline fixed. For example, compare the letter ``q'' in cmr10
and cms10 fonts:
\figure{36pt}{(Another figure will be inserted here, a really pretty one.)}
In both cases \TEX\ thinks the box is 5 points wide, so both letters get
exactly the same treatment. \TEX\ doesn't know exactly where the ink will
go---only the font designer knows this. But the slanted letters will be
spaced properly in spite of \TEX's lack of knowledge, because the baselines
will match up.
Actually the font designer also tells \TEX\ one other thing, the so-called
{\sl italic correction\/}: A number is specified for each character, telling roughly
how far that character extends to the right of its box boundary. For example,
the italic correction for ``q'' in cmr10 is zero, but in cms10 it is
0.2083 points. If you type the control sequence
$$\hbox{\≡\/≡\}$$
following a character, \TEX\ will effectively increase the width of that
character by the italic correction. It's a good idea to use {\≡\/≡\} when
shifting from slanted to unslanted fonts without intervening spaces, for example
when a slanted word is immediately followed by an unslanted right parenthesis
or semicolon. The author typed
$$\hbox{\≡the so-called {\sl italic correction\/}:≡\}$$
when specifying the first sentence of the paragraph you are now reading. Of course,
there's no need to make the italic correction when a slanted letter is
followed by an unslanted period or comma.
\yskip Another simple kind of box \TEX\ deals with might be called a ``black
box,'' a rectangle like
``\hbox{\hskip 1pt \vrule width 4pt height 6pt depth 1.5pt \hskip 1pt}''
that is to be entirely filled with ink at printing time. You can specify any
height, width, and depth you like for such boxes---but they had better not have
too much area or the printer might get upset.\xskip (Printers generally prefer white
space to black space.)
Usually these black boxes are made very skinny, so that they appear as
horizontal lines or vertical lines. Printers traditionally call such lines
``horizontal rules'' and ``vertical rules,'' so the terms \TEX\ uses to stand
for black boxes are {\≡\hrule≡\} and {\≡\vrule≡\}. We will discuss the use of
rule boxes in greater detail later.
\yskip Everything on a page that has been typeset by \TEX\ is made up of simple
character boxes or rule boxes, pasted together in combination. \TEX\ pastes
boxes together in two ways, either {\sl horizontally} or {\sl vertically}.
When \TEX\ builds a horizontal list of boxes, it lines them up so that
their reference points appear in the same horizontal row; therefore the
baselines of adjacent characters will match up as they should. Similarly, when \TEX\
builds a vertical list of boxes, it lines them up so that their reference points
appear in the same vertical column.
There is also a provision for lowering or raising the reference points
of individual boxes in a horizontal list. This has been used, for example,
to lower the ``E'' in ``\TEX''. Similarly, there is a way to move the reference
points of boxes to the left or to the right in a vertical list. This is used,
for example, when centering an accent over a letter, since an accented letter
like \'E is essentially a box made from a vertical list containing the two
character boxes ``\char'16'' and ``E''.
\danger When a big box has been made from a horizontal list of smaller boxes,
the baseline of the big box is the common baseline of the smaller boxes.\xskip (More
precisely, it's the common baseline they would share if they hadn't been raised
or lowered.)\xskip The height and depth of the big box are determined by the maximum
distances that the smaller boxes reach above and below the baseline, respectively;
any raising and lowering of the smaller boxes is taken into account during
this calculation. The width of the big box is determined by whatever \TEX\
operation was used to create that box, as explained in the next chapter.
\danger When a big box has been made from a vertical list of smaller boxes,
its reference point is the reference point of the last (lowest) box in the
list (but ignoring left or right shifts). The depth of the big box is therefore
equal to the depth of this last smaller
box. The width of the big box is determined by the
maximum distance that the smaller boxes reach to the right of the reference
point; any left or right shifting of the smaller boxes is taken into account during
this calculation.\xskip
(Note that if any of the smaller boxes have been shifted left,
they will protrude past the left boundary of the big box.) The height of the
big box is determined by whatever \TEX\ operation was used to create that box,
as explained in the next chapter.\enddanger
A page of text like the one you're reading is itself a box, in \TEX's view:
It is a largish box made from a vertical list of smaller boxes representing
the lines of text. Each line of text, in turn, is a box made from a
horizontal list of boxes representing the individual characters. In more
complicated situations, involving mathematical formulas and/or complex
tables, you can have boxes within boxes within boxes $\ldots$ to any level.
But even these complicated situations arise from horizontal or vertical lists
of boxes pasted together in a simple way, so all that you and \TEX\ have to
worry about is one list of boxes at a time. In fact, when you're typing
straight text, you hardly have to think about boxes at all, since \TEX\ will
automatically take responsibility for assembling the character boxes into
words and the words into lines and the lines into pages. You only need to be
aware of the box concept when you want to do something out of the ordinary,
like centering a heading or providing extra space, etc.
\danger The height, width, or depth of a box might be negative, in which
case it is a ``shadow box'' that is somewhat hard to draw. You might be able
to think of some tricky things to do with such boxes; \TEX\ just lines things
up and adds up dimensions as if everything were positive or zero. Thus, for
example, if a font designer specified a character with negative width, it
would act like a backspace. When forming a box from a horizontal list, however,
\TEX\ sets the height and depth to zero if they turn out to be negative, so
only the width can be negative. Similarly, only the height and depth of a
box formed from a vertical list can be negative. Negative dimensions are
not allowed in rule boxes.\enddanger
\chapterbegin 12. {Glue}
But there's more to the story than just boxes: there's also some magic mortar
called {\sl glue} that
\TEX\ uses to paste boxes together. For example, there is a little space between
the lines of text in this manual; it has been calculated so that the baselines
of consecutive lines within a paragraph are exactly 12 points apart. And
there is space between words too; such space is not an ``empty'' box, it is
part of the glue between boxes. This glue can stretch or shrink so that the
right margin of each page comes out looking straight.
When \TEX\ makes a large box from a horizontal or vertical list of smaller
boxes, there often is glue between the smaller boxes. Glue has three
attributes, namely its natural {\sl space}, its ability to {\sl stretch}, and
its ability to {\sl shrink}.
In order to understand how this works, consider the following example of
four boxes in a horizontal list separated by three globs of glue:
\figure{108pt}{(Another figure will be inserted here, but it's not very pretty.)}
The first glue element has 9 units of space, 3 of stretch, and 1 of shrink;
the next one also has 9 units of space, but 6 units of stretch and 2 of
shrink; the last one has 12 units of space, but it is unable to stretch
or to shrink, so it will remain 12 units of space no matter what.
The total width of boxes and glue in this example, considering only the
space components of the glue, is $5+9+6+9+3+12+8=52$ units. This is called
the {\sl natural width} of the horizontal list; it's the preferred way to
paste the boxes together. Suppose, however, that \TEX\ is told to make the
horizontal list into a box that is 58 units wide; then the glue has to
stretch by 6 units. Well, there are $3+6+0=9$ units of stretchability present,
so \TEX\ multiplies each unit of stretchability by 6/9 in order to obtain the
extra 6 units needed. Thus, the first glob of glue becomes $9+(6/9)\times3=11$
units wide, the next becomes $9+(6/9)\times6=13$ units wide, the last remains
12 units wide, and we obtain the desired box looking like this:
\figure{108pt}{(Yet another figure will be inserted here. This one is sort of OK.)}
On the other hand, if \TEX\ is supposed to make a box 51 units wide from the
given list, it is necessary for the glue to shrink by a total of one unit. There
are three units of shrinkability present, so the first glob of glue would
shrink by 1/3 and the second by 2/3.
\yskip
The process of determining glue thickness when a box is being made from a
horizontal or vertical list is called {\sl setting the glue}. Once glue has
been set, it becomes rigid---it won't stretch or shrink any more, and the
resulting box is essentially indecomposable.
Glue will never shrink more than its stated shrinkability. The first glob of
glue above, for example, will never be allowed to become narrower
than 8 units wide, and
\TEX\ will never shrink the given horizontal list to make its total width
less than 49 units.
But glue is allowed to stretch arbitrarily far, whenever it has a positive
stretch component.
\yskip\noindent\exno 12.1:
How wide would the glue globs be if the horizontal list in the illustrations were to
be made 100 units wide?
\danger \TEX\ is somewhat reluctant to stretch glue more than its stated
stretchability, as we shall see later when we discuss the ``badness'' of
particular glue settings. Therefore if you are trying to decide how big to
make each aspect of the glue in some layout, the rules are:\xskip (a) The natural
glue space should be the amount of space that looks best.\xskip (b) The glue
stretch should be the maximum amount of space that can be added to the natural
spacing before the layout begins to look bad.\xskip (c) The glue shrink should
be the maximum amount of space that can be subtracted from the natural spacing
before the layout begins to look bad.\enddanger
In most cases the designer of a book layout will have specified all the kinds
of glue that are to be used, so a typist will not need to decide how big any
glue attributes should be. For example, the {\sl Art of Computer Programming}
layout in Appendix E includes the definition of three control sequences
{\≡\xskip≡\}, {\≡\yskip≡\}, and {\≡\yyskip≡\}. A typist for those books
will insert {\≡\xskip≡\} within a paragraph in certain places where a little
extra stretchability is appropriate; and {\≡\yskip≡\} is inserted between
paragraphs when the paragraphs discuss somewhat different topics. Even
more space is inserted before and after theorems and algorithms, etc.; this
is called {\≡\yyskip≡\} because it is twice as much glue as {\≡\yskip≡\}.\xskip
(The same three control sequences have been used when preparing this manual.
For example, ``{\≡\xskip≡\}'' appears in the paragraph preceding this
one, just before ``(a)'', ''(b)'', and ``(c)''; and ``{\≡\yyskip≡\}'' is
used before and after every ``dangerous bend'' paragraph like the next one.)
\danger To specify glue in a horizontal list of boxes, without using a
predefined format like {\≡\xskip≡\}, type ``{\≡\hskip≡\}$\langle$dimen$
\rangle${\≡≡ plus≡\}$\langle$dimen$\rangle${\≡≡ minus≡\}$\langle$dimen$
\rangle$''. The ``{\≡plus≡\}$\langle$dimen$\rangle$'' and
``{\≡minus≡\}$\langle$dimen$\rangle$'' specify stretch and shrink components.
They are optional; and if left out, the corresponding glue component has
length zero. The space component, however, must always be given, even when it
is zero; and if zero, you must remember to type ``{\tt0pt}'', not just ``{\tt0}''.
If you are omitting the shrink component, the next characters of your text
had better not be ``{\tt minus}''. If you are omitting both stretch and
shrink components, the next characters of your text had better not be ``{\tt
plus}''. Similar remarks apply to the specification of glue in vertical lists;
the only difference is that you type ``{\≡\vskip≡\}'' instead of ``{\≡\hskip≡\}''.
\enddanger
There is one aspect of glue that a careful typist will want to be aware of,
namely that \TEX\ automatically increases the stretchability (and decreases
the shrinkability) after punctuation marks. The reason for this is that it's
usually better to put more space after a period than between two ordinary
words, when spreading a line out to reach the desired margins. Consider, for
example, the following sentences from a classic kindergarten pre-primer:
$$\hbox to size{\hskip 25pt
\≡≡`≡`Oh, oh!≡'≡'≡ cried Baby Sally. Dick and Jane laughed.≡\}$$
If \TEX\ sets this at its natural width, all the spaces will be the same:
$$\hbox to size{\hskip 25pt
\hbox{``Oh, oh!'' cried Baby Sally. Dick and Jane laughed.}\hfill}$$
But if the line needs to be expanded by 5 points, 10 points, 15 points, or more,
\TEX\ will set it as
$$\vbox{
\hbox to size{\hskip 25pt
\hbox expand 5pt{``Oh, oh!'' cried Baby Sally. Dick and Jane laughed.}\hfill}
\hbox to size{\hskip 25pt
\hbox expand 10pt{``Oh, oh!'' cried Baby Sally. Dick and Jane laughed.}\hfill}
\hbox to size{\hskip 25pt
\hbox expand 15pt{``Oh, oh!'' cried Baby Sally. Dick and Jane laughed.}\hfill}
\hbox to size{\hskip 25pt
\hbox expand 20pt{``Oh, oh!'' cried Baby Sally. Dick and Jane laughed.}\hfill}}$$
and so on. There is no glue between adjacent letters, so individual words will
always look the same.
The glue after the comma stretches at 1.25 times the rate of the
glue between adjacent words; the glue after the period and after the {\≡!≡'≡'≡\}
stretches at 3 times the rate. Furthermore if \TEX\ had to shrink this line to
its minimum width, the result would be
$$\hbox to size{\hskip 25pt
\hbox to 217.0001pt{``Oh, oh!'' cried Baby Sally. Dick and Jane laughed.}\hfill}$$
The glue after a comma shrinks only 80 per cent as much as ordinary inter-word
glue, and after a period or exclamation point it shrinks by only one third as much.
\danger The exact rule \TEX\ uses at a space is this: Each font tells \TEX\
what glue to use for spaces when that font is active. When starting to process a
horizontal list, \TEX\ sets an internal variable called the ``space factor'' to 1.
When appending a character to a horizontal list, the space factor is changed to
3 if the character is a period, question mark, or exclamation point (as determined
by its ascii code); it is changed to 2 if the character is a colon, to 1.5 if a
semicolon, to 1.25 if a comma. The space factor is left unchanged if the
character being appended is a ) or ] or ' or ''; and it is reset to 1 whenever
any other character or math formula or non-character box is appended. Furthermore,
the space factor remains unchanged when appending a character immediately
following an upper case letter.\xskip(The reason for this is to avoid treating the
period specially when it merely follows an initial, like the periods in
``P. A. M. Dirac''.)\xskip When a space is encountered, the glue space is taken from
the current font glue space specification; the stretch and shrink are obtained
by respectively multiplying and dividing the font glue stretch and shrink
specifications by the space factor. \enddanger
The only trouble with this rule is that it fails when a period isn't really a period
$\ldots$ like when it is used (as in this sentence) to make an ``ellipsis'' of
three dots, or when it is used after abbreviations. If, for example, you are
typing a bibliographic reference to {\sl Proc.\ Amer.\ Math.\ Soc.}, you don't
want the glue after these periods to be any different from the ordinary
inter-word glue. The best way to handle this is to use ``escape space'' after
a non-sentence-ending period, e.g., to type
$$\hbox{\≡Proc.\ Amer.\ Math.\ Soc.≡\}$$
This works because the space in ``{\≡\≡char'40≡\}$\,$'' always has the unmodified
inter-word
glue of the current font. Granted that this input looks a bit ugly, it does give the
best-looking output. It's one of those things we occasionally have to do
when dealing with a computer that tries to be smart.
\danger\exno 12.2: How can you defeat the rule the other way, for sentences like
``$\ldots$ launched by NASA.''?\enddanger
Incidentally, if you try to specify ``$\ldots$'' by typing three periods in
a row, you get ``...''---the dots are too close together. The best way to
handle this is to go into {\sl mathematics} mode, using the {\≡\ldots≡\}
control sequence defined in {\tt basic} \TEX\ format. For example, if you type
$$\hbox{\≡Hmmm $\ldots$ I wonder why?≡\}$$
the result is ``Hmmm $\ldots$ I wonder why?'' The reason this works is that
math formulas are exempt from normal text spacing rules.
Chapter 17 has more to say about {\≡\ldots≡\} and related topics.
\yskip
One of the interesting things that happens when glue stretches and shrinks at
different rates is that there might be glue with essentially {\sl infinite}
stretchability. For example, consider again the four boxes we had above, with
the same glue as before except that the glue in the middle has stretchability
999997 (nearly one million) instead of 6. Now the total stretchability is
one million; and when the line has to grow, almost all
of the additional space will get put into
the middle glue. If, for example, a box of width 58 is desired, the first glue
expands from 9 to 9.000018 units, the middle glue from 9 to 14.999982 units,
and of course the last glue remains exactly 12 units thick. For all practical
purposes, the spacing has gone from $9,9,12$ to $9,15,12$.
If such infinitely stretchable glue is placed at the left of a row of boxes,
the effect is to {\sl right justify} them, i.e., to move them over to the
rightmost boundary of the constructed box. And if you take {\sl two} globs of
infinitely stretchable glue, putting one at the left and one at the right, the
effect is to {\sl center} the list of boxes within a larger box. This in fact
is how the {\≡\ctrline≡\} instruction works: it places infinite glue at
both ends, then makes a box of width {\≡\hsize≡\}. [Actually the stretchability
is 1000 cm, namely 10 meters (about 33 feet); that isn't infinite, but it's
close enough.]
\danger The glue actually used in the definition of {\≡\ctrline≡\} is
{\≡\hskip 0pt plus 1000cm
minus 1000cm≡\}; in other words, {\sl both} stretch and shrink components are
essentially infinite. The reason is that if you try to center something that
is bigger than the actual {\≡\hsize≡\}, it will be centered but will extend
into the margins; the glue at left and right will shrink from 0 to something
{\sl negative}. Like box dimensions, glue components can be negative, and this
is occasionally useful for things like backspacing.
\danger ``Infinite'' glue can be specified in a horizontal list by typing
``{\≡\hfill≡\}'', or in a vertical list by typing ``{\≡\vfill≡\}''. An {\≡\hfill≡\}
instruction is equivalent to {\≡\hskip 0pt plus 10000000000pt≡\} (that's
ten {\sl billion} points), and {\≡\vfill≡\} is equivalent to {\≡\vskip≡\}ping
by the same amounts. We have already seen a typical use of {\≡\vfill≡\} in
the example of Chapter 6.\enddanger
\chapterbegin 13. {Modes}
Just as people get into different moods, \TEX\ gets into different ``modes.''\!
\xskip
(Except that \TEX\ is more predictable than people.)\xskip There are six modes:
\hsize 328pt
\def\¬{\yskip\hangindent 38pt after 1$\bullet\hskip2pt$}
\¬Vertical mode. [Building the vertical list used to make
the pages of output.]
\¬Restricted vertical mode. [Building a vertical list for
a box within a page.]
\¬Horizontal mode. [Building the horizontal list used to make
the next paragraph for the output pages.]
\¬Restricted horizontal mode. [Building a horizontal list for
a box within a page.]
\¬Math mode. [Building a mathematical formula to be placed in
a horizontal list.]
\¬Display math mode. [Building a mathematical formula to be placed
on a line by itself, temporarily interrupting the current paragraph.]
\hsize 348pt
\yskip\noindent In simple situations, you don't need to be aware of what mode
\TEX\ is in, because it just does the right thing. But when you get an error
message that says ``{\≡You can't do that in horizontal mode≡\}'', a knowledge
of modes helps explain why \TEX\ thinks you goofed.
Basically \TEX\ is in one of the vertical modes when it is preparing a list of
boxes and glue that will be placed vertically on top of one another; it's in
one of the horizontal modes when it is preparing a list of boxes and glue that
will be strung out horizontally next to each other with baselines aligned;
and it's in one of the math modes when it is reading a math formula.
A play-by-play account of a typical \TEX\ job should make the mode idea clear:
At the beginning, \TEX\ is in vertical mode, ready to construct pages. If you
specify glue or a box when \TEX\ is in vertical mode, the glue or the box gets
placed on the current page below what has already been specified. For example,
the {\≡\vskip≡\} instructions in the sample run we discussed in Chapter 6
contributed vertical glue to the page; and the {\≡\ctrline{MY STORY}≡\}
instruction contributed a box to the page. While building the {\≡\ctrline≡\}
box, \TEX\ went temporarily into restricted horizontal mode, but returned
to vertical mode after setting the glue in that box.
Continuing with the example of Chapter 6, \TEX\ switched into horizontal
mode as soon as it read the ``{\tt O}'' of ``{\tt Once upon a time}''. Horizontal
mode is the mode for making paragraphs. The entire paragraph up to the {\≡\par≡\}
was input in horizontal mode; then it was divided into lines of the appropriate
length, these lines were appended to the page (with appropriate glue between
them), and \TEX\ was back in vertical mode.
In general when \TEX\ is in vertical mode,
the first character of a new paragraph changes the mode to horizontal for the
duration of a paragraph. If a begin-math character ({\≡$≡\}) appears when in
horizontal mode, \TEX\ plunges into math mode, processes the formula up until
the closing {\≡$≡\}, then adds the text of this formula to the current
paragraph and returns to horizontal mode.\xskip (Thus, in the ``I wonder why?''\
example of the previous chapter, \TEX\ would go into math mode temporarily
while processing {\≡\ldots≡\}, treating the dots as a formula.)
However, if two consecutive begin-math characters appear in a paragraph ({\≡$$≡\}),
\TEX\ interrupts the paragraph where it is, contributes the paragraph-so-far
to the page, then processes a math formula in display math mode, then
contributes this formula to the current page, then returns to horizontal mode
for more of the paragraph.\xskip (The formula to be displayed should end with
{\≡$$≡\}.)\xskip For example, if you type
$$\hbox{\≡the number $$\pi \approx 3.1415926536$$ is important≡\}\quad,$$
\TEX\ goes into display math mode between the {\≡$$≡\}'s, and the output you
get states that the number
$$\pi\approx3.1415926536$$ is important.
\danger \TEX\ gets into restricted vertical mode when you ask it to construct
a box from a vertical list of boxes (using {\≡\vbox≡\} or {\≡\valign≡\}) or
when you do {\≡\topinsert≡\} or {\≡\botinsert≡\}. It gets into restricted
horizontal mode when you ask it to construct a box from a horizontal list
of boxes (using {\≡\hbox≡\} or {\≡\halign≡\}). Box construction is discussed
in Chapter 21. Restricted modes are like the corresponding unrestricted ones
except that you can't do certain things. For example, you can't say {\≡$$≡\}
in restricted horizontal mode, because you're not making a paragraph. You can't
begin a paragraph in restricted vertical mode, etc. All the rules about what
you can do in various modes are summarized in Chapters 24--26.\enddanger
When handling simple manuscripts, \TEX\ spends almost all of its time in
horizontal mode (making paragraphs), with brief excursions into vertical
mode (between paragraphs).
\yskip
At the end of a job, you type ``{\≡\end≡\}'' at some point when \TEX\ is in vertical
mode; this causes \TEX\ to finish any unfinished pages and stop.\xskip (Actually it
is better to type ``{\≡\vfill\end≡\}'' in most cases, since {\≡\vfill≡\} inserts
enough space to fill up the last page properly. Without the {\≡\vfill≡\},
\TEX\ attempts to stretch out the lines it has accumulated for the last
page, with the bottom line appearing at the bottom of the page; you probably
don't want this.)
\chapterbegin 14. {How \TEX\ breaks paragraphs into lines}
When the end of a paragraph is encountered, \TEX\ determines the ``best'' way
to break it into lines. In this respect, \TEX\ gives better results than most
other typesetting systems, which produce each separate line of output before
beginning the next, because the {\sl final}
words of a \TEX\ paragraph can influence how the lines at the {\sl
beginning} are broken. \TEX's new approach to this problem (based on
``sophisticated computer science techniques''---whew!) requires only a little
more computation than the traditional methods, and leads to
significantly fewer cases in which words need to be hyphenated.
$\TEX$ does try to hyphenate words, but it uses a hyphenation only when there
is no better alternative. The complete rules by which \TEX\ hyphenates words
are given in Appendix H. They are sufficiently simple that you could memorize
them and apply them by hand if you wanted to, but there probably isn't any need
for you to know them in detail. Basically \TEX's approach to hyphenation is one of
{\sl extreme caution\/}: instead of trying to find all legitimate places where a
hyphen could occur, \TEX\ sticks to hyphenations that appear to be quite safe.
In view of \TEX's improved line-breaking methods, this cautious approach to
hyphenation is usually satisfactory; but every once in a while, like all
automatic approaches to language processing, it fails. The reason for failure
is generally that a rather long nonstandard word has occurred: \TEX\ refuses
to apply automatic hyphenation to a sequence of boxes unless that sequence
\yskip\hang\textindent{a)}consists entirely of lower case letters belonging to
a single font; and
\yskip\hang\textindent{b)}is preceded immediately by glue (e.g., a space); and
\yskip\hang\textindent{c)}is followed immediately by glue or by a
punctuation mark (something that doesn't set the ``space factor'' to 1, cf.\
Chapter 12).
\yskip\noindent One consequence of these conditions is that proper names and words
containing accented letters will not be hyphenated; but such words tend to disobey
the normal hyphenation rules anyway. Another consequence is that \TEX\ won't
mess around with words for which you have explicitly prescribed the hyphenation.
And already-hyphenated compound words won't be broken up any further.
In spite of these apparently severe restrictions, experience shows that \TEX\ works
amazingly well in practice, except when the margins are extremely close
together (small {\≡\hsize≡\}); and {\sl nothing} works very well in that
case.\xskip (A large dictionary, combined with \TEX's line-breaking method,
would do the best conceivable job; but for normal books and journals it isn't
worthwhile for the computer
to waste time referring to a large dictionary. \TEX's program
and tables for hyphenation require only about 3000 words of computer memory,
so they place little burden on the overall processing.)\xskip When proofreading
the output of \TEX, the amount of additional work needed to correct missed
hyphenations is quite negligible compared to the amount of work that
proofreading already involves.
When you do find a word that \TEX\ should have hyphenated but didn't, or when
you find one of the extremely rare cases in which \TEX\ inserts a hyphen in
the wrong place, the remedy is to revise the manuscript, telling \TEX\
how to hyphenate the offending word by inserting {\sl discretionary hyphens}.
The control sequence ``{\≡\-≡\}'' indicates a discretionary hyphen, namely a
place where a word may be hyphenated if there is no better alternative.
For example, if you run into a situation where the French word {\sl
math\'ematique} must be hyphenated, you can type it as
$$\hbox{\≡math\-\≡'e\-ma\-tique≡\}\quad.$$
Another word \TEX\ has trouble with is ``onomatopoeia''; if necessary, type it in
as$$\hbox{\≡on\-o\-mat\-o\-poeia≡\}\quad.$$
(Or you could use the fancy ``\oe'' ligature, cf. Chapter 9.) But don't bother to
insert any discretionary hyphens until after
\TEX\ has failed to find a good way to break lines in some paragraph.
\danger Before describing \TEX's neat method for breaking a paragraph up into
lines, we should discuss the rules for all legal breaks in a paragraph. Here
they are: Outside of math formulas, you can break a paragraph
\yskip\hang\textindent{a)}at glue, provided that the glue is immediately
preceded by a character box or a constructed box (but not a rule box), or by
the end of a math formula, or by a discretionary hyphen, or by an
{\sl insertion} ({\≡\topinsert≡\} or {\≡\botinsert≡\}, which are explained
in Chapter 15).
\yskip\hang\textindent{b)}where a {\≡\penalty≡\} has been specified in
horizontal mode (see below), provided that the penalty is less than 1000.
\yskip\hang\textindent{c)}at a discretionary hyphenation (with the hyphen included
in the text, taken from the font that was current at the time the {\≡\-≡\}
appeared), paying a penalty of 50.
\yskip\hang\textindent{d)}where {\≡\eject≡\} has been specified (see below---this
is a way to end a page at a particular place within a paragraph).
\yskip\hang\textindent{e)}after ``{\tt-}'' or
any ligature that ends with ``{\tt-}'' (thus,
in standard roman fonts this means after ``{\tt-}'', ``{\tt--}'', or ``{\tt---}'').
\yskip\noindent Inside math formulas, you can break
\penalty-200 % good place for a page break (at one time anyway)
\yskip\hang\textindent{a)}after a binary operation like ``+'' (paying a penalty
of 95), or after a relation like ``='' (paying a penalty of 50).
\yskip\hang\textindent{b)}where a {\≡\penalty≡\} has been specified (see
below), provided that the penalty is less than 1000.
\yskip\hang\textindent{c)}at a ``discretionary math hyphen'' specified by
``{\≡\*≡\}'' (this inserts a multiplication sign $\times$ into the formula),
paying a penalty of 50.
\yskip\hang\textindent{d)}where {\≡\eject≡\} has been specified.
\yskip\noindent Note that some breaks are ``free'' but others have an
associated penalty. Penalties are used to indicate the relative desirability of
certain breaks. Breaks at {\≡\eject≡\} are compulsory; all other breaks are
optional. When a break occurs at glue or just before glue, this glue
disappears.
\danger \TEX's procedure for line breaking is based on the notion of the
``badness'' of glue setting. This is a technical concept defined by a
formula that assigns a badness of 100 to a box in which glue had to stretch
or shrink to its total amount of stretchability or shrinkability, while the
badness is near zero if the glue's stretchability or shrinkability is not
very fully utilized. Furthermore the badness increases rapidly when glue
is stretched to more than its stated limit; for example,
the badness is 800 if the glue is stretched by twice its stretchability.
Here is a precise way to calculate the badness, given that the total amount of
glue stretch and shrink are $y$ and $z$, respectively, and given that the box is
supposed to grow by an amount $x$ more than its natural width when the glue
is set:\xskip Case 1, $x≥0$ (stretching).
If $y<10↑{-4}$, replace $y$ by $10↑{-4}$. Then
the badness is $100(x/y)↑3$.\xskip Case 2, $x<0$ (shrinking).
If $z<10↑{-4}$, replace $z$ by $10↑{-4}$.
Then the badness is $100|x/z|↑3$ if $|x|≤z$, otherwise it is $∞$ (infinitely bad).
\danger When breaking lines of a paragraph, \TEX\ essentially considers all
ways to break the lines so that no line will have badness $B$ exceeding 200.
Such breaks are called ``feasible.'' Subject to this feasibility condition,
\TEX\ finds the best overall way to break, in the sense that the minimum total
number of demerits occurs, where the demerits for each line of output are calculated
as follows: If the penalty $P$ for breaking at the end of this line is $≥0$,
the number of demerits is $(B+P+1)↑2$; if $P<0$, the number is $(B+1)↑2-P↑2$.
Furthermore an additional 3000 demerits are charged if two consecutive
lines are being hyphenated or if the second-last line
of the paragraph is hyphenated. A ``dynamic programming'' technique is
used to find the breaks that lead to fewest total demerits. An attempt is
made to hyphenate all words that meet the requirements mentioned earlier,
whenever such words would straddle the end of line following some feasible break.
The hyphenation algorithm of Appendix H is used to insert discretionary
hyphens in all permissible places in such words.
In practice the computation is quite fast, and only a few hyphenations need to be
attempted, except in long paragraphs.
\danger The current value of {\≡\hsize≡\} at the close of the paragraph
is used to govern the width of each line, unless you specify ``hanging''
indentation. If you type ``{\≡\hangindent≡\}\penalty0$\langle$dimen$\rangle$
{\tt for} $\langle$number$\rangle$'', the specified dimension is supplied as an
extra indentation on the first $n$ lines of the paragraph, where $n$ is
the specified number.\xskip (That's how the second line of the paragraph you're
reading was indented.)\xskip
If you type ``{\≡\hangindent≡\}\penalty0$\langle$dimen$\rangle$
{\tt after} $\langle$number$\rangle$'', the specified dimension is supplied as an
extra indentation on all but the first $n$ lines of the paragraph. If you
type just ``{\≡\hangindent≡\}\penalty0
$\langle$dimen$\rangle$'', then ``{\tt after 1}''
is assumed. If the specified dimension is negative, indentation occurs at the
right margin instead of at the left.
\danger \TEX\ indents the first line of each paragraph by inserting an
empty box of width {\≡\parindent≡\} at the beginning, unless you start the
paragraph by typing the control sequence {\≡\noindent≡\}.
\danger The number 200 used to determine feasibility can be changed to $100n$
for any integer $n≥1$ by typing ``{\≡\jpar≡\}$\langle$number$\rangle$'', where
$n$ is the specified number. A large value of $n$ will
cause \TEX\ to run more slowly, but it makes more line breaks feasible in
cases where lines are so narrow that $n=2$ finds no solutions.
\danger The instruction {\≡\ragged≡\}$\langle$number$\rangle$ specifies a degree
of ``raggedness'' for the right-hand margins. If this number is $r$, the line
width changes towards its natural width by the ratio $r/(100+r)$. Thus, {\≡\ragged
0≡\} (the normal setting) gives no raggedness; {\≡\ragged 100≡\} causes the
width of each line to be midway between {\≡\hsize≡\} and its natural width; and
{\≡\ragged 1000000≡\} almost completely suppresses any stretching or shrinking
of the glue. Some people like to use this ``ragged right
margin'' feature in order to make the output look less formal, as if it hadn't
actually been typeset by an inhuman computer.\xskip (Some people also think that
``ragged right'' typesetting saves money. On traditional typesetting equipment,
this was true, but computer typesetting has changed the situation completely:
the most expensive part of the computation is now the breaking of lines, while the
setting of glue costs almost nothing.)
\danger The numbers 50, 3000, 95, and 50 used in the above rules
for hyphenation pen\-al\-ties, consecutive-hyphenation demerits,
binary-operation-break penalties, and
relation-break penalties, can be changed by typing
{\≡\chpar2←≡\}\penalty0$\langle$number$\rangle$,
{\≡\chpar3←≡\}\penalty0$\langle$number$\rangle$,
{\≡\chpar6←≡\}\penalty0$\langle$number$\rangle$, and
{\≡\chpar7←≡\}\penalty0$\langle$number$\rangle$, respectively. Hyphenation penalties
in force at the end of a paragraph are used throughout that paragraph;
relation and operator penalties in force at the opening {\≡$≡\} of a math
formula are used throughout that formula.
\danger To insert a penalty at a specified point in a paragraph, simply type
``{\≡\penalty≡\} $\langle$number$\rangle$''. Any penalty $≥1000$ is equivalent
to a penalty of $∞$ (a non-permissible place to break); any penalty $<1000$
implies that a break at the current place is permissible. The penalty may
be zero or even negative, to indicate an especially desirable break location.
\danger The control sequence {\≡\eject≡\} forces a break at the position where
{\≡\eject≡\} occurs, and also causes \TEX\ to begin the next line on a new
page. This gives you a way to remake page 100, say, without changing page 101,
provided that it is possible to end the new page 100 at the same place where
page 101 begins. Note that {\≡\eject≡\} will make the last line of the
paragraph-so-far reach to the right-hand margin (if feasible); this is what
some printers call a ``quad middle'' operation. It is quite different from
what you would get if you simply typed ``{\≡\par≡\}'' at the spot that the
revised page should end. \TEX's linebreaking algorithm is especially
advantageous when handling {\≡\eject≡\}, because it has an apparent
ability to ``look ahead.''
\danger Additional vertical glue specified by {\≡\parskip≡\} is inserted just
before each para\-graph. This glue gets added to the normal interline glue.
\enddanger
\chapterbegin 15. {How \TEX\ makes lists of lines into pages}
$\TEX$ attempts to choose desirable places to stop making up one page and
start another, and its technique for doing this usually works pretty well.
But if you don't like the way a page is broken, you can force a page break
in your favorite place by typing ``{\≡\eject≡\}''. An {\≡\eject≡\} command
can occur in vertical mode (e.g., between paragraphs) or in horizontal
mode (within a paragraph) or even in math mode; but you won't
need to make much use of it.
\danger \TEX\ groups things into pages in much the same way as it makes up
paragraphs, except for the lookahead feature. Badness ratings and penalties are
used to find the best place to break, but each page break is made once and for
all when this ``best'' place is found---otherwise \TEX\ would have to remember
the contents of so many pages, it would run out of memory space. Legal breaks
between pages can occur
\yskip\hang\textindent{a)}at glue, provided that the glue is immediately
preceded by a constructed box (but not a rule box). This includes the glue
routinely inserted between lines, as explained below.
\yskip\hang\textindent{b)}where a {\≡\penalty≡\} has been specified in
vertical mode, provided that the penalty is less than 1000.\xskip (Cf.\ Chapter 14.)
\yskip\hang\textindent{c)}after an insertion (arising from {\≡\topinsert≡\}
or {\≡\botinsert≡\}, see below).
\yskip\hang\textindent{d)}where {\≡\eject≡\} is specified.
\yskip\noindent Breaks at {\≡\eject≡\} are compulsory; all other breaks
are optional. When a break occurs at glue or just before glue, this glue
disappears.
\danger When boxes are appended to any vertical list (in particular, when
they are appended to the current page), glue is automatically placed between
them so that the distance between adjacent baselines tends to be the same.
For example, the lines of 9-point text you are now reading have baselines
11 points apart. This implies that the glue between lines is not always the same,
because more glue space is inserted under a line whose characters all stay above
the baseline than under a line having characters that descend below it.
Such interline glue
is appended just before each box even when you have explicitly inserted
glue yourself with {\≡\vskip≡\} or {\≡\vfill≡\}; any glue you specify is
in addition to the interline glue.
\danger Here is how interline glue gets figured: The book designer has specified
two kinds of glue by using the operations {\≡\baselineskip≡\} $\langle$glue$
\rangle$ and {\≡\lineskip≡\} $\langle$glue$\rangle$. Suppose the baselineskip
glue has $x$ units of space, $y$ units of stretch, and $z$ units of shrink.\xskip
(In this paragraph \TEX\ is using $x=11$ points, $y=z=0$, but $y$ and $z$ need
not be zero.) Suppose we are appending a box of height $h$ to a vertical list
in which the previous box (ignoring glue) had depth $d$. Then the interline glue
inserted just above the new box will have $x-h-d$ units of space, $y$ units
of stretch, and $z$ units of shrink, whenever $x-h-d≥0$; but if $x-h-d<0$,
the interline glue will be the glue specified by {\≡\lineskip≡\}. For example,
the basic \TEX\ format in Appendix B says ``{\≡\baselineskip 12 pt \lineskip 1
pt≡\}''; this means that baselines will normally be 12 points apart, but
when this is impossible a space of 1 point will be inserted between adjacent
boxes of a vertical list.\xskip {\sl Exception:}
Interline glue is not inserted before or after rule boxes, nor is it inserted
before the first box or after the last box of a vertical list.
\danger Contributions are made to the current page until the accumulated
page height minus the accumulated glue shrinkability first exceeds the
specified page size.\xskip(Page size is specified by the book designer using
{\≡\vsize≡\}, see below.)\xskip At this point the break is made at whatever legal
break in the page-so-far results in fewest badness-plus-penalty points $B+P$,
where the badness $B$ is defined as in Chapter 14 (except using vertical glue),
and where the penalty $P$ is
zero unless explicitly specified or included by the paragraphing routine.
The paragraphing routine inserts a penalty of 80 points just after the
first line and just after the penultimate
line of a multi-line paragraph, with an additional penalty
of 50 points just after a line that ends with a hyphenation. This tends to
avoid so-called ``widows'' (i.e., breaks that leave only one line
of a paragraph on a page); for example, \TEX\ breaks a four-line paragraph
without 80 points of penalty only by breaking it into $2+2$ lines.
A penalty of 500 points is charged for breaking pages just before a
displayed equation.
Furthermore there is a penalty of 80 for breaking after the first line
of text that follows a display, unless the paragraph ends with such a line.\xskip
(There is no penalty for breaking before the last line of text that precedes
a display, since such a line is not considered to be a ``widow.'')\xskip
Once the best break has been identified, the page is output, glue at
the break is deleted, and everything remaining is contributed to the
following page.\xskip (To change the numbers 80, 50, and 500 relating to widow-line,
broken-line, and display-break
penalties, you can use the {\≡\chpar≡\} instruction as explained in Chapter 24.)
\danger The height of a page is the value of {\≡\vsize≡\}, and the depth
in most cases is the depth of the bottom line on that page.
Thus, if one page has 10-point type and the next has 9-point type, the
baselines at the bottoms of both pages will be at the same place even though
the descenders of 10-point letters go slightly further below the baseline
than the descenders of 9-point letters do. However, the bottom line on
a page is sometimes a constructed box whose depth is very large, and in such a
case we want the baseline to be higher. \TEX\ deals with the problem as
follows: Whenever a box having depth greater than {\≡\maxdepth≡\} is
contributed to the current page (where ``{\≡\maxdepth≡\}\penalty0
$\langle$dimen$\rangle$'' has been specified by the book designer), the
depth of the page-so-far is artificially decreased to {\≡\maxdepth≡\},
and the height of the page-so-far is correspondingly increased.\xskip (Interline
glue calculation is not affected by this artificial adjustment, except
possibly afterwards when the page is being dealt with as a completed box.)\xskip
There is also another design parameter, ``{\≡\topbaseline≡\}\penalty0
$\langle$dimen$\rangle$'', which is used to insert glue at the top of the
page so that the baseline of the first box will be at least this distance
from the top (if it isn't a rule box).
All other glue is normally deleted at the top of each page; to put glue there,
simply insert a {\≡\null≡\} box first. If several different values of
{\≡\vsize≡\}, {\≡\maxdepth≡\}, or {\≡\topbaseline≡\} occur in the same
\TEX\ job, each page is governed by the values in force when the first
item was contributed to that page.
\danger A ``floating-insertion'' capability is built into \TEX\ so that,
among other things, illustrations can be placed at the top of the first
subsequent page on which they fit, and footnotes can be placed at the
bottom of the page on which the footnote reference appears.
Here's how it works: You type ``{\≡\topinsert{≡\}$\langle$vlist$\rangle${\≡}≡\}''
or ``{\≡\botinsert{≡\}$\langle$vlist$\rangle${\≡}≡\}'', where $\langle$vlist$
\rangle$ is a sequence of instructions that
specifies a vertical list of boxes and glue.
If such an insertion is made when \TEX\ is in vertical mode,
the specified vertical list will be contributed to the first page on which
there is room for it. If such an insertion is made when \TEX\ is in horizontal
mode, the specified vertical list will be contributed to the same page on which
the line containing the insertion appears. A {\≡\topinsert≡\} is contributed
at the top, a {\≡\botinsert≡\} at the bottom. Glue specified by
{\≡\topskip≡\}\penalty0$\langle$glue$\rangle$ will be placed just below every
{\≡\topinsert≡\}; glue specified by
{\≡\botskip≡\}\penalty0$\langle$glue$\rangle$ will be placed just above every
{\≡\botinsert≡\}.
\danger You may be wondering how things like page numbers get attached to pages.
Actually \TEX\ has two levels of control: when a complete page has been built,
this page is packaged as a box and another section of \TEX\ input code comes
into action. The designer has specified this other piece of code by writing
``{\≡\output{≡\}$\ldotsm${\≡}≡\}'', and we will discuss the details of
{\≡\output≡\} routines in Chapter 23. For now, it should suffice to give just
a small taste of what an {\≡\output≡\} routine looks like:
$$\vbox{\halign{#⊗#\hfill\cr
{\≡\output{≡\}⊗{\≡\baselineskip 20pt≡\}\cr
⊗{\≡\page\ctrline{\:a\count0}\advcount0}≡\}\cr}}$$
This routine (which appears in Appendix B)
takes the current page number, typeset in font {\tt a}, and centers it on
a new line below the contents of the current page; ``{\≡\page≡\}'' means the
current page, ``{\≡\count0≡\}'' means the current page number, and ``{\≡
\advcount0≡\}'' advances this number by 1. The baseline of the page number will
be 20 points below the baseline of the page---assuming that {\≡\maxdepth≡\} has
been set small enough that this is always possible. This setting of
{\≡\baselineskip≡\} will be retracted at the end of the {\≡\output≡\} routine,
according to the normal conventions of grouping; thus there will be no effect
on \TEX's page-building operations (which go on asynchronously).\enddanger
\chapterbegin 16. {Typing math formulas}
$\TEX$ was designed to handle complex mathematical formulas in such a way
that most of them are easy to input. The basic idea is that a complicated
formula is composed of less complicated formulas put together in a simple way,
and these less complicated formulas are in turn made up of simple
combinations of formulas that are even less complicated, and so on. Stating
this another way, if you know how to type simple formulas and how to combine
formulas into larger ones, you will be able to handle virtually any formula
at all. So let's start with simple ones and work our way up.
The simplest formula is a single letter, like ``$x$'', or a single number,
like ``2''. In order to enter these into a \TEX\ text, you type ``{\≡$x$≡\}''
and ``{\≡$2$≡\}'', respectively. Note that all mathematical formulas are enclosed in
special math brackets, and we are using {\≡$≡\} as the math bracket in
this manual, in accord with the basic \TEX\ format defined in Appendix B.
Note further that when you type ``{\≡$x$≡\}'' the ``$x$'' comes out in italic
type, but when you type ``{\≡$2$≡\}'' the ``$2$'' comes out normally.
In general, all characters on your keyboard have a special interpretation
in math formulas, according to the normal conventions of mathematics
printing. Letters now denote italic letters, while digits and punctuation
denote roman digits and punctuation;
a hyphen ({\tt-}) now denotes a minus sign ($-$), which is almost the same
as an em-dash but not quite (see Chapter 2). So if you forget one {\≡$≡\} or
type one {\≡$≡\} too many, \TEX\ will probably become thoroughly confused
and you will probably get some sort of error message.
\penalty-200 % good place to break the page
Formulas that have been typeset by a printer who is unaccustomed
to doing mathematics
usually look quite wrong to a mathematician, because a novice printer usually
gets the spacing all wrong. In order to alleviate this problem, \TEX\ does
most of its own spacing in math formulas; and it {\sl ignores} any spaces
you type between {\≡$≡\}'s. For example, you can type ``{\≡$ x$≡\}'' and
``{\≡$ 2 $≡\}'' and they will mean the same thing as ``{\≡$x$≡\}'' and
``{\≡$2$≡\}''; you can type ``{\≡$(x + y)/(x - y)$≡\}'' or
``{\≡$(x+y) / (x-y)$≡\}'', but both will result in
``$(x+y)/(x-y)$''. Thus, you are free to use blank spaces in any way you like.
Of course, spaces are still used in the normal way to mark the end of
control sequences, as explained in Chapter 7.
In most circumstances \TEX's spacing will be what a mathematician
is accustomed to; but we will see in Chapter 18 that there are control sequences
by which you can override \TEX's spacing rules if you want.
One of the things mathematicians like to do is make their formulas look like
Greek to the uninitiated. In \TEX\ language you can type ``{\≡$$\alpha,
\beta, \gamma, \delta;$$≡\}'' and you will get the first four Greek letters
$$\alpha,\beta,\gamma,\delta;$$
furthermore there are upper case Greek letters like ``$\Gamma$'', which you
can get by typing either ``{\≡$\Gamma$≡\}'' or ``{\≡$\GAMMA$≡\}''. A few of
the Greek letters deserve special attention: For example, lower case
epsilon ($\epsilon$) is quite different from the symbol used to denote membership
in a set ($\in$); type ``{\≡$\epsilon$≡\}'' for $\epsilon$ and ``{\≡$\in$≡\}''
for $\in$.
Furthermore, three of the lower case Greek letters have variant forms on
\TEX's standard italic fonts; ``{\≡$(\phi,\theta,\omega)$≡\}'' yields
``$(\phi,\theta,\omega)$'' while ``{\≡$(\varphi,\vartheta,\varomega)$≡\}''
yields ``$(\varphi,\vartheta,\varomega)$''.
Besides Greek letters, there are a lot of funny symbols like ``$\approx$''
(which you get by typing ``{\≡$\approx$≡\}'') and ``$\mapsto$'' (which you
get by typing ``{\≡$\mapsto$≡\}''). A complete list of these control sequences
and the characters they correspond to appears in Appendix F. The list even
includes some non-mathematical symbols like
$$\section\quad\dag\quad\ddag\quad\P\quad\copyright\quad\$\quad\sterling$$
which you can get by typing ``{\≡$\section$≡\}'', ``{\≡$\dag$≡\}'',
``{\≡$\ddag$≡\}'', ``{\≡$\P$≡\}'', ``{\≡$\copyright$≡\}'', ``{\≡$\$$≡\}'', and
``{\≡$\sterling$≡\}'', respectively; nearly all of
the special symbols that you'll ever want are available in this way.
Such control sequences are allowed only in math mode, i.e., between
{\≡$≡\}'s, even when the corresponding symbols aren't traditionally
considered to be mathematical, because they appear in the math fonts.
\yskip Now let's see how more complex formulas get built up from simple ones.
In the first place, you can get superscripts and subscripts by using ``{\≡↑≡\}''
and ``{\≡≡↓≡\}'':
$$\vbox{\baselineskip15pt
\halign to size{\hskip 25pt\hbox to 160pt{#\hfill}⊗$# $\hfill
\tabskip 0pt plus 100pt\cr
Type⊗\hbox{\hskip-10pt and you get}\cr
{\≡$x↑2$≡\}⊗x↑2\cr
{\≡$x≡↓2$≡\}⊗x↓2\cr
{\≡$2↑x$≡\}⊗2↑x\cr
{\≡$x↑2y↑2$≡\}⊗x↑2y↑2\cr
{\≡$x ↑ 2y ↑ 2$≡\}⊗x ↑ 2y ↑ 2\cr
{\≡$x≡↓2y≡↓2$≡\}⊗x↓2y↓2\cr
{\≡$≡↓2F≡↓3$≡\}⊗↓2F↓3\cr}}$$
Note that {\≡↑≡\} and {\≡≡↓≡\} apply only to the next single character.
If you want several things to be subscripted or superscripted, just enclose
them in braces:
$$\vbox{\baselineskip15pt
\halign to size{\hskip 25pt\hbox to 160pt{#\hfill}⊗$# $\hfill
\tabskip 0pt plus 100pt\cr
{\≡$x↑{2y}$≡\}⊗x↑{2y}\cr
{\≡$2↑{2↑x}$≡\}⊗2↑{2↑x}\cr
{\≡$2↑{2↑{2↑x}}$≡\}⊗2↑{2↑{2↑x}}\cr
{\≡$x≡↓{y≡↓2}$≡\}⊗x↓{y↓2}\cr
{\≡$x≡↓{y↑2}$≡\}⊗x↓{y↑2}\cr}}$$
It is illegal to type ``{\≡x↑y↑z≡\}'' or ``{\≡x≡↓y≡↓z≡\}'' (\TEX\ will
complain of a ``double superscript'' or ``double subscript''); you must type
``{\≡x↑{y↑z}≡\}'' or ``{\≡{x↑y}↑z≡\}'' or ``{\≡x↑{yz}≡\}'' in order to make your
intention clear.\xskip (Some commonly-used
languages for math typesetting treat {\≡x↑y↑z≡\} as {\≡x↑{y↑z}≡\} and
others treat it as {\≡{x↑y}↑z≡\} or {\≡x↑{yz}≡\}; the ambiguous construction
isn't needed much anyway, so \TEX\ disallows it.)
A subscript or superscript following nothing (as in the ``{\≡≡↓2F≡↓3≡\}''
example above, where the {\≡≡↓2≡\} follows nothing) is taken to mean a
subscript or superscript of an empty box. A subscript or superscript following
a character applies to that character only, but when following a box it
applies to that whole box; for example,
$$\vbox{\baselineskip15pt
\halign to size{\hskip 25pt\hbox to 160pt{#\hfill}⊗$# $\hfill
\tabskip 0pt plus 100pt\cr
{\≡$((x↑2)↑3)↑4$≡\}⊗((x↑2)↑3)↑4\cr
{\≡${({(x↑2)}↑3)}↑4$≡\}⊗{({(x↑2)}↑3)}↑4\cr}}$$
In the first formula the {\≡↑3≡\} and {\≡↑4≡\} are superscripts on the right
parentheses, but in the second formula they are superscripts on the formulas
enclosed in braces.
You can have simultaneous subscripts and superscripts, and you can specify them
in any order:
$$\vbox{\baselineskip15pt
\halign to size{\hskip 25pt\hbox to 160pt{#\hfill}⊗$# $\hfill
\tabskip 0pt plus 100pt\cr
{\≡$x↑2≡↓3$≡\}⊗x↑2↓3\cr
{\≡$x≡↓3↑2$≡\}⊗x↓3↑2\cr
{\≡$x↑{31415}≡↓{92}+\pi$≡\}⊗x↑{31415}↓{92}+\pi\cr
{\≡$x≡↓{y↑a≡↓b}↑{z≡↓c↑d}$≡\}⊗x↓{y↑a↓b}↑{z↓c↑d}\cr}}$$
Note that simultaneous sub/superscripts are positioned over each other, aligned
at the left.
The control sequence {\≡\prime≡\} stands for the character ``$\prime$'', which
is used mostly in superscripts. Here's a typical example:
$$\hbox to size{\hskip 25pt{\≡$y≡↓1↑\prime+y≡↓2↑{\prime\prime\prime}$≡\}\hfill
$y↓1↑\prime+y↓2↑{\prime\prime\prime}$\hfill}$$
\penalty-200 % Good place for a page break
Another way to get complex formulas from simple ones is to use the control
sequences {\≡\sqrt≡\}, {\≡\underline≡\}, or {\≡\overline≡\}.
These operations apply to the character or group that follows them:
$$\vbox{\baselineskip15pt
\halign to size{\hskip 25pt\hbox to 160pt{#\hfill}⊗$# $\hfill
\tabskip 0pt plus 100pt\cr
{\≡$\sqrt2$≡\}⊗\sqrt2\cr
{\≡$\sqrt{x+2}$≡\}⊗\sqrt{x+2}\cr
{\≡$\underline4$≡\}⊗\underline4\cr
{\≡$\underline{\underline4}$≡\}⊗\underline{\underline4}\cr
{\≡$x↑{\underline n}$≡\}⊗x↑{\underline n}\cr
{\≡$\overline{x↑3+\sqrt3}$≡\}⊗\overline{x↑3+\sqrt3}\cr}}$$
\danger If you need cube roots (or $n↑{\hbox{\:d th}}$ roots), \TEX\ has no
built-in mechanism for this. But you can insert a 3 (or $n$) over a square
root sign by using Appendix B's control sequence {\≡\spose≡\} for superposition.
Type
$$\hbox{{\≡\spose{\raise≡\}$\langle$dimen$\rangle${\≡\hbox{\hskip≡\}$\langle
$dimen$\rangle${\≡$\scriptscriptstyle≡\}$\langle$root$\rangle${\≡$}}≡\}}$$
followed by {\≡\sqrt...≡\},
where you can figure out appropriate dimensions by fiddling around until the
position looks right.\xskip(These dimensions depend on the size of the formula, the
current size of type, and the size of the square root sign.)\xskip For example,
``{\tenpoint $\spose{\raise 5pt\hbox{\hskip 2.5pt$\scriptscriptstyle3$}}\sqrt5\,
$}'' can be set with \TEX's normal 10-point fonts by typing
$$\hbox to size{{\≡
$\spose{\raise5pt\hbox{\hskip2.5pt$\scriptscriptstyle3$}}\sqrt5$≡\}\hskip 18pt
minus 18pt.}$$
\danger Accents in math mode work something like {\≡\overline≡\}; you can
accent a single character or a formula.\xskip (But the formula had better be
short, since a tiny accent will be centered over the whole thing.)\xskip
For example,
$$\hbox{\≡$\=x+\overline x+\b x+\A x+\s x+\s{\s x}+\A{x+y}+e↑{\=x}$≡\}$$
produces
$\textstyle\=x+\overline x+\b x+\A x+\s x+\s{\s x}+\A{x+y}+e↑{\=x}$.
\tenpoint\yyskip
\noindent\exno 16.1: What would you type to get the following formulas?
$$2↑{n+1}\qquad(n+1)↑2\qquad\sqrt{1-x↑2}\qquad\overline{w+\overline z}\qquad
p↓1↑{e↓1}\qquad a↓{b↓{c↓{d↓e}}}\qquad h↓n↑{\prime\prime}(x)$$
\noindent\exno 16.2: What's wrong with typing the following?
$$\hbox{\≡If$ x = y$, then $x$ is equal to $y.$≡\}$$
\noindent\exno 16.3: Explain how to type the following sentence:
$$\hbox{Deleting an element from an $n$-tuple leaves an $(n-1)$-tuple.}$$
\chapterbegin 17. {More about math}
Another thing mathematicians like to do is make fractions---and they
also like to build up symbols on top of each other, as in
$${1\over2}\qquad\hbox{and}\qquad{n+1\over3}\qquad\hbox{and}\qquad
{n+1\comb[]3}\qquad\hbox{and}\qquad\sum↓{n=1}↑3 Z↓n\quad.$$
You can get these four formulas by typing ``{\≡$$1\over 2$$≡\}'' and
``{\≡$$n+1\over 3$$≡\}'' and ``{\≡$$n+1\comb[]3$$≡\}'' and
``{\≡$$\sum≡↓{n=1}↑3 Z≡↓n$$≡\}'';
we shall study the simple rules for such constructions in this chapter.
First let's look at fractions, which use the ``{\≡\over≡\}'' notation. The
control sequence {\≡\over≡\} applies to everything in the formula unless you
enclose {\≡\over≡\}
in a \hbox{\≡{ }≡\} group; in the latter
case it applies to everything in that group.
$$\vbox{\baselineskip15pt\lineskip6pt
\halign to size{\hskip 25pt\hbox to 160pt{#\hfill}⊗$\dispstyle{#}$\hfill
\tabskip 0pt plus 100pt\cr
Type⊗\hbox{\hskip-10pt and you get}\cr
\noalign{\vskip 4pt}
{\≡$$x+y↑2\over k+1$$≡\}⊗x+y↑2\over k+1\cr
{\≡$$x+{y↑2\over k}+1$$≡\}⊗x+{y↑2\over k}+1\cr
{\≡$$x+{y↑2\over k+1}$$≡\}⊗x+{y↑2\over k+1}\cr
{\≡$$x+y↑{2\over k+1}$$≡\}⊗x+y↑{2\over k+1}\cr}}$$
You aren't allowed to use {\≡\over≡\} twice in the same group; instead of typing
a formula like
``{\≡a \over b \over 2≡\}'', you must specify what goes over what:
$$\vbox{\baselineskip15pt\lineskip12pt
\halign to size{\hskip 25pt\hbox to 160pt{#\hfill}⊗$\dispstyle{#}$\hfill
\tabskip 0pt plus 100pt\cr
{\≡$${a\over b}\over 2$$≡\}⊗{a\over b}\over 2\cr
{\≡$$a\over{b\over 2}$$≡\}⊗a\over{b\over 2}\cr}}$$
Note that the letters get smaller when they are fractions-within-fractions,
just as they get smaller when they are used as exponents. It's about time that
we studied how \TEX\ does this. Actually \TEX\ has eight different styles
in which it can treat formulas, namely
$$\vbox{\halign{#\hfill\quad⊗#\hfill\cr
display style⊗(for formulas displayed on lines by themselves)\cr
text style⊗(for formulas embedded in the text)\cr
script style⊗(for formulas used as superscripts or subscripts)\cr
scriptscript style⊗(for second-order superscripts or subscripts)\cr}}$$
and four other styles that are almost the same except that exponents aren't
raised quite so much. For brevity we shall refer to the eight styles as
$$D,\ T,\ S,\ SS,\ D↑\prime,\ T↑\prime,\ S↑\prime,\ SS↑\prime,$$
so that $T$ is text style, $D↑\prime$ is modified display style, etc. \TEX\
also uses three sizes of type for mathematics, called text size, script size,
and scriptscript size ($t$, $s$, and $ss$).
The normal way to typeset a formula with \TEX\ is to enclose it in dollar
signs {\≡$≡\}$\ldotsm${\≡$≡\}, which yields the formula in text style
(style $T$), or to enclose it in double dollar signs {\≡$$≡\}$\ldotsm${\≡$$≡\},
which displays the formula in display style (style $D$). Once you know
the style, you can determine the size of type \TEX\ will use:
$$\vbox{\halign{\ctr{#}\qquad⊗\ctr{#}\cr
If a letter is in style⊗then it will be set in size\cr
\noalign{\vskip 2pt}
$D,T,D↑\prime,T↑\prime$⊗$t$\cr
$S,S↑\prime$⊗$s$\cr
$SS,SS↑\prime$⊗$ss$\cr}}$$
There is no ``$SSS$'' style or ``$sss$'' size; such tiny symbols would be
even less readable than the $ss$ ones. Therefore \TEX\ stays with $ss$ as
its minimum size, as shown in the following chart:
$$\vbox{\halign{\ctr{#}\qquad⊗\ctr{#}\qquad⊗\ctr{#}\cr
In a formula⊗the superscript⊗and the subscript\cr
of style⊗style is⊗style is\cr
\noalign{\vskip 2pt}
$D,T$⊗$S$⊗$S↑\prime$\cr
$S,SS$⊗$SS$⊗$SS↑\prime$\cr
$D↑\prime,T↑\prime$⊗$S↑\prime$⊗$S↑\prime$\cr
$S↑\prime,SS↑\prime$⊗$SS↑\prime$⊗$SS↑\prime$\cr}}$$
For example, if {\≡x↑{a≡↓b}≡\} is in style $D$, then {\≡{a≡↓b}≡\} is in style
$S$, and {\tt b} is in style $SS↑\prime$.
So far we haven't seen any difference between styles $D$ and $T$. Actually
there is a slight difference in the positioning of exponents: you get
$\dispstyle x↑2$ in $D$ style and $x↑2$ in $T$ style and \vbox to 7pt{
\vskip 0pt plus 10pt minus 10pt
\hbox{$\dispstyle{\atop x↑2}$}\vfill} in $D↑\prime$ or $T↑\prime$ style---do
you see the difference? But there is a big distinction between $D$ style and
$T$ style when it comes to fractions:
$$\vbox{\halign{\hfill#\hfill\qquad⊗\ctr{#}\qquad⊗\ctr{#}\cr
In a formula⊗the style of the⊗and the style of the\cr
$\alpha${\≡\over≡\}$\,\beta$ of style⊗numerator $\alpha$ is⊗denominator
$\beta$ is\cr
\noalign{\vskip 2pt}
$D$⊗$T$⊗$T↑\prime$\cr
$T$⊗$S$⊗$S↑\prime$\cr
$S,SS$⊗$SS$⊗$SS↑\prime$\cr
$D↑\prime$⊗$T↑\prime$⊗$T↑\prime$\cr
$T↑\prime$⊗$S↑\prime$⊗$S↑\prime$\cr
$S↑\prime,SS↑\prime$⊗$SS↑\prime$⊗$SS↑\prime$\cr}}$$
Thus if you type ``{\≡$1\over2$≡\}'' (in a text) you get $1\over2$, namely style
$S$ over style $S↑\prime$; but if you type
``{\≡$$1\over2$$≡\}'' you get $$1\over2$$ (a displayed formula), which is style
$T$ over style $T↑\prime$.
When a fraction like {\≡$x+y\over z$≡\} is put into the text of a paragraph,
the letters are rather small and hard to read: $x+y\over z$.
So it is usually better to type the fraction in the mathematically equivalent
way ``{\≡$(x+y)/z$≡\}'', which comes out ``$(x+y)/z$''. In other words,
{\≡\over≡\} is useful mostly for displayed formulas or for numeric fractions.
\danger While we're at it, we might as well finish the style rules: {\≡\underline≡\}
does not change the style; {\≡\sqrt≡\} and {\≡\overline≡\} both change $D$ to
$D↑\prime$, $T$ to $T↑\prime$, $S$ to $S↑\prime$, $SS$ to $SS↑\prime$, and leave
$D↑\prime$, $T↑\prime$, $S↑\prime$, $SS↑\prime$ unchanged.\enddanger
There's another operation ``{\≡\atop≡\}'', which is like {\≡\over≡\} except that
it leaves out the fraction line:
$$\vbox{\baselineskip15pt\lineskip6pt
\halign to size{\hskip 25pt\hbox to 160pt{#\hfill}⊗$\dispstyle{#}$\hfill
\tabskip 0pt plus 100pt\cr
{\≡$$x\atop y+2$$≡\}⊗x\atop y+2\cr}}$$
The basic math definitions in
Appendix B also define ``{\≡\choose≡\}'', which is like {\≡\atop≡\} but it
encloses the result in parentheses:
$$\vbox{\baselineskip15pt\lineskip6pt
\halign to size{\hskip 25pt\hbox to 160pt{#\hfill}⊗$\dispstyle{#}$\hfill
\tabskip 0pt plus 100pt\cr
{\≡$$n\choose k$$≡\}⊗n\choose k\cr}}$$
This is a common notation for the so-called ``binomial coefficient'' that tells
how many ways there are to choose $k$ things out of $n$ things; that's why
the control sequence is called {\≡\choose≡\}.
You can't mix {\≡\over≡\} and {\≡\atop≡\} and {\≡\choose≡\} with each other.
For example, ``{\≡$$n \choose k \over 2$$≡\}'' is illegal; you must use
grouping, to get either ``{\≡$${n \choose k} \over 2$$≡\}'' or
``{\≡$$n \choose {k \over 2}$$≡\}'', i.e.,
$${{n\choose k}\over2}\qquad\hbox{or}\qquad{n\choose{k\over2}}\quad.$$
The latter formula, incidentally, would look better as
``{\≡$$n \choose k/2$$≡\}'' or
``{\≡$$n \choose {1\over2}k$$≡\}'', yielding
$${n\choose k/2}\qquad\hbox{or}\qquad{n\choose{1\over2}k}\quad.$$
Suppose you don't like the style \TEX\ selects by its automatic style rules.
Then you can specify the style you
want by typing
$$\hbox to size{{\≡\dispstyle≡\} or {\≡\textstyle≡\} or {\≡\scriptstyle≡\}
or {\≡\scriptscriptstyle≡\}.}$$ For example, if you want the $n\choose k$ to be
larger in the formula {\≡$${n\choose k}\over 2$$≡\},
just type ``{\≡$$\dispstyle{n\choose k}\over 2$$≡\}''; you will get
$$\dispstyle{n\choose k}\over 2$$
because the numerator of the formula is now ``{\≡\dispstyle{n\choose k}≡\}''.
Here's another example (admittedly a rather silly one): {\≡$$n+\scriptstyle n
+\scriptscriptstyle n$$≡\} gives
$${n+\scriptstyle n+\scriptscriptstyle n}\quad .$$
Note that the plus signs get smaller too, as the style changes; and there's no
space around + signs in script style.
\yyskip\noindent\exno 17.1: Explain how to specify the displayed formula
$${p \choose 2}x↑2 y↑{p-2} - {1 \over 1-x}{1 \over 1-x↑2}\quad.$$
\danger There are two other variants of {\≡\over≡\}, {\≡\atop≡\}, etc. First
is ``{\≡\above≡\}\penalty0$\langle$dimen$\rangle$'', which is just like
{\≡\over≡\} but the stated dimension specifies the exact thickness of the line
rule. For example,
$$\hbox{\≡$$\dispstyle{x\over y}\above 1pt\dispstyle{w\over z}$$≡\}$$
will produce
$${\dispstyle{x\over y}\above 1pt\dispstyle{w\over z}}\quad;$$
this sort of thing was once customary in arithmetic textbooks, but nowadays it
is rare (at least in pure mathematics). The second variant is a generalization
of {\≡\choose≡\}: You can write ``{\≡\comb≡\}$\langle$delim$\rangle\langle
$delim$\rangle$'', specifying any of the delimiters listed in Chapter 18;
``{\≡\choose≡\}'' is the same as ``{\≡\comb()≡\}'', and one of the examples
at the beginning of this section used ``{\≡\comb[]≡\}''.
\danger When you use {\≡\over≡\}, {\≡\atop≡\}, etc., the numerator and
denominator are centered over each other. If you prefer to have the
numerator or denominator at the left, follow it by ``{\≡\hfill≡\}''; if you
prefer to have it at the right, precede it by ``{\≡\hfill≡\}''. For example,
the specification
$$\vbox{\halign{\quad#\hfill\cr
{\≡$$1+{1\hfill\over\dispstyle a≡↓1+{1\hfill\over\dispstyle≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡
a≡↓2+{1\hfill\over\dispstyle a≡↓3+{1\over a≡↓4}}}}$$≡\}\cr}}$$
yields
$$1+{1\hfill\over\dispstyle a↓1+{1\hfill\over\dispstyle
a↓2+{1\hfill\over\dispstyle a↓3+{1\over a↓4}}}}$$
while without the {\≡\hfill≡\}s you get
$$1+{1\over\dispstyle a↓1+{1\over\dispstyle
a↓2+{1\over\dispstyle a↓3+{1\over a↓4}}}}\quad.$$
\yyskip
\tenpoint Mathematicians often use the sign $\sum$ to stand for ``summation''
and the sign $\int$ to stand for ``integration.'' If you're a typist but not
a mathematician, all you need to remember is that {\≡\sum≡\} stands for
$\sum$ and {\≡\int≡\} for $\int$; these abbreviations appear in Appendix F
together with all the other symbols, in case you forget. Symbols like
$\sum$ and $\int$ (and a few others like $\union$ and $\prod$ and $\oint$
and $\oprod$, all listed in Appendix F) are called {\sl large operators},
and you type them just as you type ordinary symbols or letters. The
difference is that \TEX\ will choose a {\sl larger} large operator in
display style than it will in text style. For example,
$$\vbox{\baselineskip15pt\lineskip6pt
\halign to size{\hskip 25pt#\hfill⊗\qquad yields\qquad$#$\hfill\qquad
⊗#\hfill\tabskip 0pt plus 100pt\cr
{\≡$\sum x≡↓n$≡\}⊗\sum x↓n⊗($T$ style)\cr
{\≡$$\sum x≡↓n$$≡\}⊗\dispstyle\sum x↓n⊗($D$ style).\cr}}$$
Usually $\sum$ occurs with ``limits,'' i.e., with formulas that are to
appear below it or to the right. You type limits just the same as superscripts
and subscripts: for example, if you want
$$\sum↓{n=1}↑m$$
you type either ``{\≡$$\sum≡↓{n=1}↑m$$≡\}'' or ``{\≡$$\sum↑m≡↓{n=1}$$≡\}''.
According
to the normal conventions of mathematics, \TEX\ will change this to ``$\sum
↓{n=1}↑m$'' if in text style rather than display style.
Integrations are slightly different from summations, in that the limits get set
at the right even in display style:
$$\vbox{\baselineskip15pt\lineskip6pt
\halign to size{\hskip 25pt#\hfill⊗\qquad yields\qquad$#$\hfill\qquad
⊗#\hfill\tabskip 0pt plus 100pt\cr
{\≡$\int≡↓{-≡∞}↑{+≡∞}$≡\}⊗\int↓{-∞}↑{+∞}\qquad(T\hbox{ style})\cr
{\≡$$\int≡↓{-≡∞}↑{+≡∞}$$≡\}⊗\dispstyle\int↓{-∞}↑{+∞}\qquad(D\hbox{ style}).\cr}}$$
Note further that the subscript is not directly below the superscript, in either
style; again, this is a mathematical convention that \TEX\ follows automatically
(based on information stored with the fonts).
\danger Some printers prefer to set limits above and below $\int$ signs; similarly,
some prefer to set limits to the right of $\sum$ signs. You can change \TEX's
convention by simply typing ``{\≡\limitswitch≡\}'' after the large operator.
For example,
$$\vbox{\baselineskip15pt\lineskip6pt
\halign to size{\hskip 25pt#\hfill⊗\qquad yields\qquad$\dispstyle{#}$\hfill
\tabskip 0pt plus 100pt\cr
{\≡$$\int\limitswitch≡↓{-≡∞}↑{+≡∞}$$≡\}⊗\int\limitswitch↓{-∞}↑{+∞}\cr
{\≡$$\sum\limitswitch≡↓{n=1}↑m$$≡\}⊗\sum\limitswitch↓{n=1}↑m\cr}}$$
\vskip-6pt
\danger If you have to put two or more rows of limits under a large operator, you
can do this by using ``{\≡\atop≡\}''. For example, if you want the displayed
formula $$\sum↓{\scriptstyle0≤i≤m\atop\scriptstyle0<j<n}P(i,j)$$ the correct
way to type it is
$$\hbox{\≡$$\sum≡↓{\scriptstyle0≡≤i≡≤m\atop\scriptstyle0<j<n}P(i,j)$$≡\}$$
(perhaps with a few more spaces to make it look nicer in the manuscript
file). Note that
the instruction ``{\≡\scriptstyle≡\}'' was necessary here,
twice---otherwise ``$0≤i≤m$''
and ``$0<j<n$'' would have been in scriptscript size, which is too
small. This is one of the rare cases where \TEX's automatic style rules
need to be overruled.\enddanger
\noindent\exno 17.2: How would you type the displayed formula $\dispstyle
\sum↓{i=1}↑p\sum↓{j=1}↑q\sum↓{k=1}↑r a↓{ij}b↓{jk}c↓{ki}$\hskip10pt minus10pt?
\danger\exno 17.3: And how about $\dispstyle\sum↓
{{\scriptstyle1≤i≤p\atop\scriptstyle1≤j≤q}\atop\scriptstyle1≤k≤r}
a↓{ij}b↓{jk}c↓{ki}$\quad?\enddanger
\chapterbegin 18. {Fine points of mathematics typing}
We have discussed most of the facilities needed to construct math formulas,
but there are several more things a good mathematical typist will want to
watch for.
\yskip{\bf$\underline{\hbox{1. Punctuation.}}$\xskip}When a formula is followed
by a period, comma, semicolon, colon, question mark, exclamation point, etc.,
put the punctuation {\sl after} the {\≡$≡\}, when the formula is in the text;
but put the punctuation {\sl before} the {\≡$$≡\} when the formula is displayed.
For example,
$$\hbox{\≡If $x<0$, we have shown that $$y=f(x).$$≡\}$$
The reason is that \TEX's spacing rules within paragraphs work best when the
punctuation marks are not considered part of the formulas.
Similarly, don't type something like this:
$$\hbox to size{\hskip 25pt{\≡for $x = a, b$, or $c$.≡\}\hfill}$$
It should be
$$\hbox to size{\hskip 25pt{\≡for $x = a$, $b$, or $c$.≡\}\hfill}$$
The reason is that \TEX\ will always put a ``thin space'' between the comma and
the {\tt b} in \hbox{\≡$x = a, b$≡\}. This space will probably not be the
same as the space \TEX\ puts after the comma {\sl after} the {\tt b}, since the
second comma is outside the formula; and such unequal spacing would look bad.
When you type it right, the spacing will look good. Another reason for
not typing ``\hbox{\≡$x = a, b$≡\}'' is that it inhibits the possibilities
for breaking lines in a paragraph: \TEX\ will never break at the space between
the comma and the {\tt b} because breaks after commas in formulas are usually
wrong. For example, in the equation ``\hbox{\≡$x = f(a, b)$≡\}'' we certainly
don't want to put ``$x=f(a,$'' on one line and ``$b)$'' on the next.
Thus, when typing formulas in the text of a paragraph, keep the math properly
segregated: Don't take operators like $-$ and $=$ outside of the {\≡$≡\}'s,
and keep commas inside the formula if they are truly part of the formula.
But if a comma or period or other punctuation mark
belongs linguistically to the sentence rather than
to the formula, leave it outside the {\≡$≡\}'s.
\yskip{\bf$\underline{\hbox{2. Roman letters in formulas.}}$\xskip}The names of
algebraic variables
in formulas are usually italic or Greek letters, but common mathematical
operators like ``log'' are always set in roman type. The best way to deal
with such operators is to make use of the following control sequences defined
in the {\tt basic} format of Appendix B:
$$\vbox{\halign{\tt\char'134#\hfill\qquad⊗\tt\char'134#\hfill\qquad
⊗\tt\char'134#\hfill\qquad⊗\tt\char'134#\hfill\qquad⊗\tt\char'134#\hfill\cr
cos⊗exp⊗lim⊗log⊗sec\cr
cot⊗gcd⊗liminf⊗max⊗sin\cr
csc⊗inf⊗limsup⊗min⊗sup\cr
det⊗lg⊗ln⊗Pr⊗tan\cr}}$$
The following examples show that such control sequences lead to roman type
as desired:
$$\vbox{\baselineskip15pt\lineskip6pt
\halign to size{\hskip 10pt\hbox to 225pt{#\hfill}⊗$#$\hfill
\tabskip 0pt plus 100pt\cr
Type⊗\hbox{\hskip-10pt and you get}\cr
\noalign{\vskip 4pt}
{\≡$\sin2\theta=2\sin\theta\cos\theta$≡\}⊗\sin2\theta=2\sin\theta\cos\theta\cr
{\≡$O(n\log n\log\log n)$≡\}⊗O(n\log n\log\log n)\cr
{\≡$\exp(-x↑2)$≡\}⊗\exp(-x↑2)\cr
{\≡$$\max≡↓{1≡≤n≡≤m}\log≡↓2P≡↓n$$≡\}⊗\dispstyle{\max↓{1≤n≤m}\log↓2P↓n}\cr
{\≡$$\lim≡↓{x→0}{\sin x\over x}=1$$≡\}⊗\dispstyle{\lim↓{x→0}{\sin x\over x}=1}\cr
}}$$
In the second example, note that $O$ is an upper case letter ``oh'', not a zero;
a formula should usually have ``{\tt O}'' instead of ``{\tt0}'' when a left
parenthesis follows. The fourth and fifth examples show that some of the special
control sequences are treated by \TEX\ as ``large operators'' with limits
just like $\sum$; compare the different treatment of subscripts applied to
{\≡\max≡\} and to {\≡\log≡\}.
\danger Another way to get roman type into mathematical formulas is to
include constructed boxes (cf.\ Chapter 21); such boxes are treated the
same as single characters or subformulas. For example,
$$\hbox{\≡$\exp(x+\hbox{constant})$≡\}\qquad\hbox{yields}\qquad
\exp(x+\hbox{constant})\quad.$$
The fonts used inside such boxes are the same as the fonts used {\sl outside}
of the math brackets {\≡$≡\}$\ldotsm${\≡$≡\}; the characters do {\sl not}
change size when the style changes.
\danger\exno 18.1: Explain how to type the
phrase ``$n↑{\hbox{\:d th}}$ root'', where ``$n↑{\hbox{\:d th}}$'' is
treated as a mathematical formula with a superscript. The letters ``th'' should
be in font {\tt d}.
\danger There is, of course, a way to specify characters that do change size
with changing styles; you can do it with the {\≡\char≡\} command. We studied
{\≡\char≡\} in Chapter 8, but {\≡\char≡\} works a little differently in
math mode because math mode deals with up to ten fonts instead of just one
font. \TEX\ keeps three fonts for text size, three for script size,
and three for scriptscript size, plus one font for oversize and variable-size
characters. The three fonts of changing size are called {\tt rm}, {\tt it}, and
{\tt sy} fonts---short for roman, italic, and symbols, according to \TEX's
normal way of using these fonts; and the oversize font is called the {\tt ex}
font.\xskip
(The {\tt rm} and {\tt it} fonts are essentially normal fonts like all other fonts
\TEX\ deals with, but each {\tt sy} and {\tt ex} font must have special control
information stored with it, telling \TEX\ how to do proper spacing of math
formulas. Thus, \TEX\ is able to do math typesetting on virtually any style
of font, provided that the font designer includes these parameters.)\xskip
To specify which fonts you are using for mathematics, you type
$$\vbox{\def\\{$\langle$font$\rangle$}
\halign{\tt\char'134math#⊗#\\⊗#\\⊗#\\\cr
rm⊗ ⊗⊗\cr
it⊗ ⊗⊗\cr
sy⊗ ⊗⊗\cr
ex⊗ \cr}}$$
before getting into math mode, where the {\tt rm}, {\tt it}, and {\tt sy} fonts
are specified in the order text size, script size, scriptscript size. For
example, by typing ``{\≡\mathit tpk≡\}'' you are saying that \TEX\ should use
font {\tt t} as the {\tt it} font in text size math, font {\tt p} as the {\tt it}
font in script size math, font {\tt k} in scriptscript size math. If you
don't use scriptscript size in your formulas, you must still specify a font,
but you could say ``{\≡\mathit tpp≡\}'' or even ``{\≡\mathit ttt≡\}''.\xskip
(When you specify a font letter for the first time you must follow it with
the font file name, as described in Chapter 4; e.g., ``{\≡\mathit t←cmi10
p←cmi7 p≡\}'' would work. But it's best to declare all your fonts first,
before specifying the ones to be used for math.)\xskip Now$\,\ldots$ about that
``{\≡\char≡\}'' operation in math mode: Although {\≡\char≡\} selects up to
128 characters in non-math modes, it selects up to 512 characters in math mode.
Characters \char'16 000 to \char'16 177 are in the {\tt rm} font of the
current size, \char'16 200 to \char'16 377 are in the {\tt it} font of the
current size, \char'16 400 to \char'16 577 are in the {\tt sy} font of the
current size, and \char'16 600 to \char'16 777 are in the {\tt ex} font.
For example, the ``dangerous bend'' road symbol is
in the {\tt ex} font being used to typeset this user manual, and it is
actually character number \char'16 177 in this font, so it is referred to
by typing ``{\≡$\char≡'777$≡\}''. The symbol $\infty$ is character number
\char'16 61 in \TEX's standard symbol fonts; in math mode you can refer to it
either as ``{\≡\infty≡\}'' or as ``{\≡\char≡'461≡\}'', or simply as ``{\≡≡∞≡\}''
if you happen to have this key on your keyboard.
\danger \TEX\ fonts used for variables (``{\tt it}'' fonts) have spacing
appropriate for math formulas but not for italic text. You should use a different
font for ``italicized words'' in the text. For example:
$$\vbox{\halign{#\hfill\cr
\:gThis sentence is in font cmi10, which is intended for formulas, not text.\cr
\:?This sentence is in font cmti10, which is intended for text, not formulas.\cr}}$$
\tenpoint{\bf$\underline{\hbox{3. Lar}}$g$\underline{\hbox{e }}$p\hskip-3pt
$\underline{\hbox{\hskip3pt arentheses and other delimiters.}}$\xskip}
Since mathematical formulas can get horribly large, \TEX\ has to have some
way to make ever-larger symbols.
For example, if you type
$$\vbox{\halign{#\hfill\cr
{\≡$$\sqrt{1+\sqrt{1+\sqrt{1+≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+x}}}}}}}$$≡\}\cr}}$$
the result shows a variety of available square-root signs:
$$\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+x}}}}}}}$$
The three largest signs here are all essentially the same, except for a vertical
segment ``\vbox{\hbox{\:@\char'165}\vfill}'' that gets repeated as often as
necessary to reach the desired size; but the smaller signs are distinct characters
found in \TEX's math fonts.
A similar thing happens with parentheses and other so-called ``delimiter'' symbols.
For example, here are the different sizes of parentheses that \TEX\ might use
in formulas:
$$\left(\vbox to 27pt{}\left(\vbox to 24pt{}\left(\vbox to 21pt{}
\biggglp\bigglp\mathopen{\vcenter{\hbox{\:@\char'20}}}\biglp(
\hbox{\:b(\:c(\:d(\:e(\:f(\hskip3pt)\:e)\:d)\:c)\:b)})\bigrp
\mathclose{\vcenter{\hbox{\:@\char'21}}}\biggrp\bigggrp\right)\right)\right)$$
The three largest pairs are made with repeatable extensions, so they can become
as large as necessary.
$\TEX$ chooses the correct size of square root sign by simply using the smallest
size that will enclose the formula being {\≡\sqrt≡\}ed, but it does not use
large parentheses or other delimiters unless you ask it to. If you want to
enclose a formula in variable-size delimiters, type
$$\hbox{{\≡\left≡\}$\langle$delim$↓1\rangle$ $\langle$formula$\rangle$
{\≡\right≡\}$\langle$delim$↓2\rangle$}$$
where each $\langle$delim$\rangle$ is one of the following:
$$\vbox{\halign{\hfill#\quad⊗#\hfill\qquad\qquad⊗\hfill#\quad⊗#\hfill\cr
{\tt.}⊗blank ( \ \ )⊗{\tt|}⊗vertical line ( $|$ )\cr
{\tt(}⊗left parenthesis ( ( )⊗{\≡\|≡\}⊗double vertical line ( $\|$ )\cr
{\tt)}⊗right parenthesis ( ) )⊗{\≡\langle≡\} or \tt<⊗left angle bracket ( $\langle$
)\cr
{\tt[}⊗left bracket ( [ )⊗{\≡\rangle≡\} or \tt>⊗right angle bracket ( $\rangle$
)\cr
{\tt]}⊗right bracket ( ] )⊗{\≡\lfloor≡\}⊗left floor bracket ( $\lfloor$ )\cr
{\≡\{≡\}⊗left brace ( $\{$ )⊗{\≡\rfloor≡\}⊗right floor bracket ( $\rfloor$ )\cr
{\≡\}≡\}⊗right brace ( $\}$ )⊗{\≡\lceil≡\}⊗left ceiling bracket ( $\lceil$ )\cr
{\≡/≡\}⊗slash ( $/$ )⊗{\≡\rceil≡\}⊗right ceiling bracket ( $\rceil$ )\cr}}$$
For example, if you type ``{\≡$$1+ \left( 1\over1-x↑2 \right) ↑3$$≡\}'' you will get
$$1+\left(1\over1-x↑2\right)↑3\quad.$$
Notice from this example that {\≡\left≡\} and {\≡\right≡\} have the effect of
grouping just as {\≡{≡\} and {\≡}≡\} do: The ``{\≡\over≡\}'' operation does
not apply to the ``{\tt 1+}'' or to the ``{\≡↑3≡\}'', and the ``{\≡↑3≡\}'' applies
to the entire formula enclosed by {\≡\left(≡\} and {\≡\right)≡\}.
When you use {\≡\left≡\} and {\≡\right≡\} they must match each other, nesting like
braces do in groups. You can't have {\≡\left≡\} in one formula and {\≡\right≡\}
in another, nor can you type things like ``{\≡\left(...{...\right)...}≡\}''.
This restriction makes sense, of course, but it is worth explicit mention here
because you do {\sl not} have to match parentheses and brackets, etc., when
you are not using {\≡\left≡\} and {\≡\right≡\}: \TEX\ will not complain if you
input a formula like ``{\≡$[0,1)$≡\}'' or even ``{\≡$)($≡\}''.\xskip (And it's a
good thing \TEX\ doesn't, for such unbalanced formulas occur surprisingly often
in mathematics papers.)\xskip Even when you are using {\≡\left≡\} and {\≡\right≡\},
\TEX\ doesn't look closely at the particular delimiters you happen to choose;
thus, you can type strange things like ``{\≡\left)≡\}'' and/or ``{\≡\right(≡\}''
if you know what you're doing. Or even if you don't.
If you type ``{\≡\left.≡\}'' or ``{\≡\right.≡\}'', the corresponding delimiter
is blank---not there. Why on earth would anybody want that, you may ask. Well,
there are at least two reasons. One is to take care of situations like this:
$$|x|=\left\{\vcenter{\halign{\lft{$#$,}\qquad⊗if \lft{$#$}\cr x⊗x≥0;\cr-x⊗x<0.\cr}}
\right.$$ The formula in this case could be typed as follows:
$$\hbox{{\≡$$|x|=\left\{ ... \right.$$≡\}}$$
where ``{\tt...}'' stands for a \TEX\ box containing the text
$$\def\boxit#1{\vbox{\hrule\hbox{\vrule\vbox{#1}\vrule}\hrule}}
\vcenter{\boxit{\halign{\lft{$#$,}\qquad⊗if \lft{$#$}\cr x⊗x≥0;\cr-x⊗x<0.\cr}}}$$
Later in this chapter we shall discuss how you might specify such a box;
just now we are simply trying to discuss the use of a blank delimiter.
The second example of a blank delimiter occurs when you want a variable-size
slash; type either ``{\≡\left/ ... \right.≡\}'' or ''{\≡\left. ...
\right/≡\}'', whichever will make the correct size slash (i.e., a slash that
is just big enough for the formula enclosed between {\≡\left≡\} and {\≡\right≡\}).
For example, if you want to get the formula
$$\left. a+1 \over b \right/ {c+1\over d}$$
you can type either ``{\≡$$\left. a+1 \over b \right/ {c+1\over d}$$≡\}'' or
``{\≡$${a+1\over b} \left/ c+1 \over d \right.$$≡\}''.
\danger A third example, which occurs less often, is the problem of getting
three large delimiters of the same size, as in a formula of the form ``$[\;α\;|\;β
\;]$'' where $α$ and $β$ are large formulas and, say, $α$ is bigger than $β$. You
can type
$$\hbox{{\≡\left.\left[≡\}$\;α\;${\≡\right|≡\}$\;β\;${\≡\right]≡\}}$$
to handle this. Note that a construction like ``{\≡\left(\left( ...
\right)\right)≡\}'' will always produce double parentheses of the same size.
\enddanger
The size chosen by \TEX\ when you use {\≡\left≡\} and {\≡\right≡\} is usually
appropriate, but there is an important exception: When the {\≡\left≡\} and
{\≡\right≡\} enclose a displayed $\sum$ or $\prod$, etc., with upper and/or
lower limits, \TEX\ will often make the delimiters much too large. For example,
if you type
$$\hbox{\≡$$\left( \sum≡↓{i=1}↑n A≡↓i \right)↑2$$≡\}$$
the result is
$$\left(\sum↓{i=1}↑n A↓i\right)↑2$$
(rather shocking). The reason is that \TEX\ adds extra blank space above and
below the limits so that they don't interfere with surrounding formulas;
usually this is the right thing to do, except when large delimiters are
involved. In fact, most math compositors prefer to let the limits on $\sum$'s
protrude above or below any enclosing parentheses, so {\≡\left≡\} and {\≡\right≡\}
aren't really the proper things to type anyway. What you should do is use
control sequences such as {\≡\bigglp≡\} and {\≡\biggrp≡\}, which are defined
in the {\tt basic} \TEX\ format (Appendix B).
When the above example is retyped in the form
$$\hbox{\≡$$\bigglp \sum≡↓{i=1}↑n A≡↓i \biggrp↑2$$≡\}$$
it will come out right:
$$\bigglp\sum↓{i=1}↑n A↓i\biggrp↑2\quad.$$
Incidentally, {\tt basic} format also defines two other useful sizes of
parentheses, for those occasions when you wish to control the size by yourself
in a convenient manner: {\≡\biglp≡\} and {\≡\bigrp≡\} produce parentheses
that are just a little bit bigger than normal ones, while {\≡\biggglp≡\} and
{\≡\bigggrp≡\} produce really big ones. Here is a typical example of
a formula that uses {\≡\biglp≡\} and {\≡\bigrp≡\}:
$$\biglp x-s(x)\bigrp\biglp y-s(y)\bigrp.$$
\exno 18.2: Explain exactly how to type this formula so that \TEX\ would
typeset it as shown.
\danger Instead of using ``bigg'' delimiters, there is another way to
get \TEX\ to choose a more reasonable size with respect to displayed
$\sum$'s with limits, namely to fool \TEX\ into thinking that the
formulas aren't as big as they really are. Using Appendix B, type
``{\≡\chop to ≡\}$\langle$dimen$\rangle${\≡{≡\}$\langle$formula$\rangle${\≡}≡\}''
to produce a box containing the specified formula in display style but with
the depth of the box artificially assumed to be the specified dimension. The
$\langle$dimen$\rangle$ must be in points ({\tt pt}). For
example, $$\hbox{\≡\sqrt{\chop to 9pt{\sum≡↓{1≡≤k≡≤n}A≡↓k}}≡\}$$ yields
{\tenpoint$$\sqrt{\chop to 9pt{\sum↓{1≤k≤n}A↓k}}\quad.$$}
\penalty-300 % avoids bad page break ahead
\danger You can also access other delimiters that might be present in your fonts
by using the versatile {\≡\char≡\} command. We saw above that {\≡\char≡\} has
an extended meaning in math mode; its meaning is even further extended when
used to specify delimiters. Besides the options listed above, any $\langle$delim$
\rangle$ can be ``{\≡\char≡'≡\}$c↓1c↓2$'' where $c↓1$ and $c↓2$ are three-digit
octal codes; $c↓1$ is the code for this delimiter in its smaller sizes
({\tt rm}, {\tt it}, or {\tt sy} fonts) and $c↓2$ is the code for this delimiter
in the {\tt ex} font. For example, it turns out that
the left brace delimiter can be
specified as {\≡\char≡'546610≡\}, since
a normal size left brace is character
\char'16 146 in the {\tt sy} font, and since
all oversize left braces are reachable
starting at character \char'16 010 in the {\tt ex} font.\xskip (Characters in an
{\tt ex} font are internally linked together in order of increasing size.)\xskip You
should let $c↓1$ or $c↓2$ equal {\tt000} if there is no corresponding character.
\TEX\ handles variable-size delimiters in the following way: If $c↓1≠\hbox{\tt000}
$, the first step is to look at math character \char'16$c↓1$ in the current size,
then in any larger sizes.\xskip (For example, in script style \TEX\ looks first at
script size character \char'16$c↓1$, then at the corresponding character in text
size.)\xskip If $c↓2≠\hbox{\tt000}$,
the next step is to look at all characters linked together in the
{\tt ex} font, starting at \char'16$c↓2$,
in increasing order of size.\xskip (This linked list might end with
an extensible character.)\xskip The first character \TEX\ sees that is large enough
(i.e., $≥$ the desired size) is chosen. Special note to those who have read
this far: Standard {\tt ex} fonts for \TEX\ often contain the ``left pretzel''
and ``right pretzel'' delimiters that you can get by typing $$\hbox{\≡\left\char≡'
000656≡\}\qquad\hbox{and}\qquad\hbox{\≡\right\char≡'000657≡\},$$
respectively. Startle your friends by
using these instead of parentheses around your big matrices, or try typing
``{\≡$$\left\char≡'656\quad\vcenter{\hbox par 250pt{
... several sentences of text ...
}}\quad\right\char≡'657$$≡\}''.\enddanger
\yskip{\bf$\underline{\hbox{4. S}}$p\hskip-3pt$\underline{\hbox{\hskip3pt
acin}}$g$\underline.$\xskip}Chapter 16 says that \TEX\ does automatic spacing
of math formulas so that they look right, and this is almost true, but
occasionally you must give \TEX\ some help. The number of possible math
formulas is vast, and \TEX's spacing rules are rather simple, so it is
natural that exceptions should arise. Furthermore there are occasions when
you need to specify the proper spacing between two formulas. Perhaps the
most common example of this is a display containing a main formula and side
conditions, like
$$F↓n=F↓{n-1}+F↓{n-2},\qquad n≥2.$$
You need to tell \TEX\ how much space to put after the comma.
\penalty-300 % avoids bad page break ahead
The traditional hot-metal technology for printing has led to some ingrained
standards for situations like this, based on what printers call a ``quad''
of space. Since these standards seem to work well in practice, \TEX\ makes
it easy for you to continue the tradition. When you type ``{\≡\quad≡\}'',
\TEX\ converts this into an amount of space equal
to a printer's quad, approximately the width of a capital M.\xskip (The em-dash
discussed in Chapter 2 is usually one quad wide; and one quad in 10-point
type is usually equal to 10 points. This is where the name ``quad'' comes from;
it once meant a square piece of blank type. But of course a font designer
is free to specify any sizes that he or she wants for the widths of quads,
em-dashes, and M's.)
The abbreviation ``{\≡\qquad≡\}'' is defined in Appendix B to be the same
as ``{\≡\quad\quad≡\}'', and this is the normal spacing for situations like
the $F↓n$ example above. Thus, the recommended procedure is to type
$$\hbox to size{\hskip25pt{\≡$$ F≡↓n = F≡↓{n-1} + F≡↓{n-2}, \qquad
n ≡≥≡ 2. $$≡\}\hfill}$$
It is perhaps worth reiterating that \TEX\ ignores all the spaces in math
mode (except, of course, the space after ``{\≡\qquad≡\}'', which is needed
to distinguish ``{\≡\qquad n≡\}'' from ``{\≡\qquadn≡\}''); so the same result
would be obtained if you were to type
$$\hbox to size{\hskip25pt{\≡$$F≡↓n=F≡↓{n-1}+F≡↓{n-2},\qquad
n≡≥2.$$≡\}\hfill}$$
Thus, all spacing that differs from the normal conventions has to be specified
explicitly by control sequences such as {\≡\quad≡\} and {\≡\qquad≡\}.
Of course, {\≡\quad≡\} and {\≡\qquad≡\} are big chunks of space, more than
the space between words in a sentence, so it is desirable to have much finer
units. The basic elements of space that \TEX\
deals with in math formulas are often called
a ``thin space'' and a ``thick space'', defined respectively to be
$1\over6$ of a quad and $5\over18$ of a quad. In order to get a feeling for
these units, let's take a look at the $F↓n$ example again: thick spaces
occur just before and after the = sign, and also before and after the $≥$ sign.
A thin space is slightly smaller, yet quite noticeable; it's a thin space that
makes the difference between ``loglog'' and ``$\log\log$''.
$\TEX$ has variable glue, as we discussed in Chapter 12, so spaces in \TEX's
math formulas actually can get a little thicker or thinner when a line is being
stretched or squeezed. Here is a precise chart telling about all the different
kinds of spaces that you can specify in math formulas:
\noindent$$\vbox{\halign to size{\hbox to 60pt{\hskip 10pt#\hfill}⊗\!
\hbox to 110pt{#\hfill(}⊗$\hfill#$⊗$,\hfill#$⊗$,\hfill#)\qquad($⊗$\hfill#$⊗$,
\hfill#$⊗$,\hfill#)$\tabskip 0pt plus 100pt\cr
\noalign{\hbox to size{\hskip5pt
$\vcenter{\hbox to 55pt{Control\hfill}\hbox to 55pt{sequence\hfill}}$\hbox to
115pt{\hskip20pt Name\hfill}$\lpile{
\hbox{Spacing in}\cr\hbox{styles $D,T,D↑\prime,T↑\prime$}\cr}\hfill\rpile{
\hbox{Spacing in styles}\cr\hbox{$S,SS,S↑\prime,SS↑\prime$}\cr}$}}
\noalign{\vskip 8pt}
{\≡\,≡\}⊗Thin space⊗1/6⊗0⊗0⊗1/6⊗0⊗0\cr
{\≡\≡char'40≡\}⊗Control space⊗2/9⊗1/9⊗2/9⊗1/6⊗0⊗0\cr
{\≡\>≡\}⊗Op space⊗2/9⊗1/9⊗2/9⊗0⊗0⊗0\cr
{\≡\;≡\}⊗Thick space⊗5/18⊗5/18⊗0⊗0⊗0⊗0\cr
{\≡\quad≡\}⊗Quad space⊗1⊗0⊗0⊗1⊗0⊗0\cr
{\≡\≡≥≡\}⊗Conditional thin space⊗1/6⊗0⊗0⊗0⊗0⊗0\cr
{\≡\!≡\}⊗Negative thin space⊗-1/6⊗0⊗0⊗-1/6⊗0⊗0\cr
{\≡\?≡\}⊗Negative thick space⊗-5/18⊗-5/18⊗0⊗0⊗0⊗0\cr
{\≡\<≡\}⊗Negative op space⊗-2/9⊗-1/9⊗-2/9⊗0⊗0⊗0\cr
{\≡\≡≤≡\}⊗Negative {\≡\≡≥≡\}⊗-1/6⊗0⊗0⊗0⊗0⊗0\cr}}$$
(Don't try to memorize this chart, just plan to use it for reference in
case of need.)\xskip The spacing is given in units of quads; thus, for example,
the entry ``$(5/18,5/18,0)$'' for a thick space in $D$ style means that a
thick space in displayed formulas is $5\over18$ of a quad wide, with a
stretchability of $5\over18$ quad and a shrinkability of zero. Note that
spacing is different in subscript or superscript styles: thick spaces
disappear while thin spaces stay the same. This reflects the fact that
no space surrounds = signs in subscripts, but there still remains a space
in ``$\scriptstyle\log\log$'' when you type ``{\≡\log\log≡\}'' in a script style.
The control sequences in this table are allowed only in math mode,
except that {\≡\quad≡\} is allowed also in horizontal mode.
Actually {\≡\≡char'40≡\} and {\≡\!≡\} are used in horizontal mode too,
but with a different meaning explained earlier. It is permissible to
use {\≡\hskip≡\} explicitly in math mode, if you want to specify any
nonstandard glue.
As mentioned earlier, you will probably not be using any of these spaces
very much. You can probably get by with only an occasional {\≡\quad≡\} (or
{\≡\qquad≡\}) and an occasional thin space.
In fact, there are probably only three occasions on which you should always
remember to insert a thin space (``{\≡\,≡\}''):
\yskip\hang\textindent{a)}Before the $dx$ or $dy$ or $d$whatever in
formulas involving calculus. For example,
type ``{\≡$\int≡↓0↑≡∞ e↑x\,dx$≡\}'' to get ``$\int↓0↑∞e↑x\,dx$'';
type ``{\≡$dx\,dy=r\,dr\,≡penalty 0 d\theta$≡\}'' to get
``$dx\,dy=r\,dr\,d\theta$''.\xskip (But type ``{\≡$dy/dx$≡\}''.)
\yskip\hang\textindent{b)}After square roots that happen to come too close
to the following symbol. For example, ``{\≡$O\biglp 1/\sqrt n\bigrp$≡\}''
comes out as ``$O\biglp1/\sqrt n\bigrp$'', but
``{\≡$O\biglp 1/\sqrt n\,\bigrp$≡\}'' yields
``$O\biglp 1/\sqrt n\,\bigrp$''. And it sometimes looks better to
put a thin space after a square root to separate it visually from a symbol that
follows: ``$\sqrt2\,x$'' is preferable to ``$\sqrt2x$'', so type ``{\≡
$\sqrt2\,x$≡\}'' instead of ``{\≡$\sqrt2 x$≡\}''.
\yskip\hang\textindent{c)}After an exclamation point (which stands for the
``factorial'' operation in a formula) when it is followed by a letter or number
or left delimiter. For example, ``{\≡$(2n)!\over n!\,(n+1)!$≡\}''.
\yskip\noindent Other than this, you can usually rely on \TEX's spacing until
after you look at what comes out, and it shouldn't be necessary to insert
optical spacing corrections except in rather rare circumstances.\xskip (One of
these circumstances is a formula like ``$\,\log n\,(\log\log n)↑2\,$'', where a
thin space has been inserted just before the left parenthesis; \TEX\
inserts no space before this parenthesis, because similar formulas
like ``$\log f(x)$'' want no space there. Another case is a formula like ``$n/\!
\log n$'', where a negative thin space has been inserted after the slash.)
\danger Here are the rules \TEX\ uses to govern spacing:
The styles and sizes
of all portions of a formula are determined as explained in Chapter 17.
We may assume that
the formula doesn't have the form ``$α${\≡\over≡\}$\,β$'' (or
``$α${\≡\atop≡\}$\,β$'', etc.), since numerators and denominators of such formulas
are treated separately. We may also assume that all subformulas of a given formula
have been processed already (using the same rules)
and replaced by boxes.\xskip (Subformulas include anything enclosed
in \hbox{\≡{ ... }≡\}, possibly combined with {\≡\sqrt≡\}, {\≡\underline≡\},
{\≡\overline≡\}, or {\≡\accent≡\}; subformulas also include anything enclosed
in {\≡\left≡\}$\langle$delim$↓1\rangle${\≡≡
... \right≡\}$\langle$delim$↓2\rangle$,
unless this turns out to be the entire formula. Subscripts and
superscripts are attached to the appropriate boxes, and so any given formula
can be reduced to a list of boxes to be placed next to each other; all that
remains is to insert the appropriate spacing. The boxes are divided into seven
categories:
{\def\¬{\yskip\hangindent38pt\textindent{$\bullet$}}
\¬Ord box; e.g., an ordinary variable like {\tt x},
or a subformula like {\≡\sqrt{x+y}≡\} that has already been converted into a box.
\¬Op box; e.g., a $\sum$ sign (together with its limits, if any), or an operator
like {\≡\log≡\} that has already been converted into a box.
\¬Bin box; e.g., a binary operator like {\tt+} or {\tt-} or {\≡\times≡\} (but
not {\tt/}, which is treated as ``Ord'').
\¬Rel box; e.g., an {\tt=} sign or a {\tt<} sign or a {\tt←}.
\¬Open box; e.g., a left parenthesis or {\≡\left≡\}$\langle$delim$\rangle$.
\¬Close box; e.g., a right parenthesis or {\≡\right≡\}$\langle$delim$\rangle$.
\¬Punct box; a comma or semicolon (but not a period, which is treated as ``Ord'').
}\yskip\noindent Every Bin box must be preceded by an Ord box or a Close box,
and followed by an Ord or Op or Open box, otherwise Bins are reclassified as Ords,
from left to right.\xskip
(For example, in ``{\≡-≡∞<x+y<+≡∞≡\}'', only the {\tt+} of ``{\tt x+y}'' is
a Bin box; the two {\tt<} signs are Rel boxes, and all other symbols are Ord
boxes.)\xskip
Now the spacing between any pair of adjacent boxes is determined by the
following table:
$$\vbox{\vskip-6pt\hbox to 310pt{\hskip 100pt\hfill Right box type\hfill}
\vskip 3pt
\def\¬{\vrule height 8.5pt depth 2.5pt}
\def\∂{\vrule height 2pt}
\baselineskip0pt\lineskip0pt
\halign{\hbox to 100pt{#}⊗\hbox to 30pt{\hfill#\hfill}⊗\!
\hbox to 30pt{\hfill#\hfill}⊗\hbox to 30pt{\hfill#\hfill}⊗\!
\hbox to 30pt{\hfill#\hfill}⊗\hbox to 30pt{\hfill#\hfill}⊗\!
\hbox to 30pt{\hfill#\hfill}⊗\hbox to 30pt{\hfill#\hfill}⊗#\hfill\cr
⊗Ord⊗Op⊗Bin⊗Rel⊗Open⊗Close⊗Punct\cr
\noalign{\vskip 2pt}
\noalign{\moveright 100pt \vbox{\hrule width 210pt}}
\hfill\∂⊗⊗⊗⊗⊗⊗⊗⊗\∂\cr
\hfill Ord\quad\¬⊗0⊗{\≡\,≡\}⊗{\≡\>≡\}⊗{\≡\;≡\}⊗0⊗0⊗0⊗\¬\cr
\hfill Op\quad\¬⊗{\≡\,≡\}⊗{\≡\,≡\}⊗\tt*⊗{\≡\;≡\}⊗0⊗0⊗0⊗\¬\cr
Left\hfill Bin\quad\¬⊗{\≡\>≡\}⊗{\≡\>≡\}⊗\tt*⊗\tt*⊗{\≡\>≡\}⊗\tt*⊗\tt*⊗\¬\cr
box\hfill Rel\quad\¬⊗{\≡\;≡\}⊗{\≡\;≡\}⊗\tt*⊗0⊗{\≡\;≡\}⊗0⊗0⊗\¬\cr
type\hfill Open\quad\¬⊗0⊗0⊗\tt*⊗0⊗0⊗0⊗0⊗\¬\cr
\hfill Close\quad\¬⊗0⊗{\≡\,≡\}⊗{\≡\>≡\}⊗{\≡\;≡\}⊗0⊗0⊗0⊗\¬\cr
\hfill Punct\quad\¬⊗{\≡\≡≥≡\}⊗{\≡\≡≥≡\}⊗\tt*⊗{\≡\;≡\}⊗{\≡\≡≥≡\}⊗{\≡\≡≥≡\}⊗{\≡\≡≥≡\}⊗\¬
\cr
\hfill\∂⊗⊗⊗⊗⊗⊗⊗⊗\∂\cr}
\moveright 100pt \vbox{\hrule width 210pt}}$$
Here ``0'' means no space is inserted; ``{\≡\,≡\}'' is a thin space; and so on.
Table entries marked ``{\tt*}'' are never needed, because of the definition
of Bin boxes.
\danger For example, consider the displayed formula
$$\hbox{\≡$$x+y=\max\{x,y\}+\min\{x,y\}$$≡\}\quad,$$
which is transformed into the sequence of boxes
$$\def\\#1{\vbox to 33pt{\vbox to 22pt{\vfill\hrule
\hbox{\vrule\hskip-.4pt$#1$\hskip-.4pt\vrule}}\hrule\vfill}}
\vcenter{\vskip-11pt\hbox{$
\\x\;\;\\+\;\;\\y\;\;\\=\;\;\\\max\;\;\\\{\;\;
\\x\;\;\\,\;\;\\y\;\;\\\}\;\;\\+\;\;\\\min\;\;\\\{
\;\;\\x\;\;\\,\;\;\\y\;\;\\\}$}\vskip-11pt}$$
of respective types
$$\hbox{Ord,Bin,Ord,Rel,Op,Open,Ord,Punct,Ord,Close,Bin,Op,Open,\!
Ord,Punct,Ord,Close.}$$
Inserting the appropriate spaces according to the table gives
\def\twoline#1#2#3{\halign{\hbox to size{##}\cr$\quad\dispstyle{#1}$\hfill\cr
\noalign{\penalty 1000\vskip#2}\hfill$\dispstyle{#3}\quad$\cr}}
$$\vbox{\hbox to size{\quad Ord{\≡\>≡\}Bin{\≡\>≡\}Ord{\≡\;≡\}Rel{\≡\;≡\}Op$\,
$Open$\,$Ord$\,$Punct{\≡\≡≥≡\}Ord$\,$Close\hfill}
\hbox to size{\hfill{\≡\>≡\}Bin{\≡\>≡\}Op$\,$Open$\,$Ord$\,
$Punct{\≡\≡≥≡\}Ord$\,$Close\quad}}$$
and the resulting formula is
$$\def\\#1{\vbox to 33pt{\vbox to 22pt{\vfill\hrule
\hbox{\vrule\hskip-.4pt$#1$\hskip-.4pt\vrule}}\hrule\vfill}}
\vcenter{\vskip-11pt\hbox{$
\\x\ \\+\ \\y\;\\=\;\\\max\\\{
\\x\\,\,\\y\\\}\ \\+\ \\\min\\\{
\\x\\,\,\\y\\\}$}\vskip-11pt}$$
i.e.,$$x+y=\max\{x,y\}+\min\{x,y\}\spose{\quad.}$$
\penalty-300\noindent
This example doesn't involve subscripts or superscripts; but subscripts and
superscripts merely get attached to boxes without changing the type of box. If
you have inserted any spacing yourself by means of {\≡\quad≡\} or {\≡\,≡\} or
{\≡\hskip≡\} or whatever, \TEX's automatic spacing gets included in addition
to what you specified. Similarly, if you have included {\≡\penalty≡\} or
{\≡\eject≡\} or {\≡\*≡\} in a math formula, this specification is ignored for
purposes of calculating the automatic glue between components of formulas.
For example, if you type ```{\≡$... =\penalty100 x ...$≡\}'', there is a Rel
box (=) followed by a penalty specification (which tends to avoid
breaking lines here) followed by an Ord box ($x$), so \TEX\ inserts ``{\≡\;≡\}''
glue between the penalty and the Ord box.
\danger You can
make \TEX\ think that a character or formula is Op or Bin or $\cdots$
or Punct by typing one of the instructions {\≡\mathop≡\}$\langle$atom$\rangle$
or {\≡\mathbin≡\}$\langle$atom$\rangle$
or {\≡\mathrel≡\}$\langle$atom$\rangle$ or {\≡\mathopen≡\}$\langle$atom$\rangle$
or {\≡\mathclose≡\}$\langle$atom$\rangle$ or {\≡\mathpunct≡\}$\langle$atom$\rangle$,
where $\langle$atom$\rangle$ is either a single character (like {\tt x}), or
a control sequence denoting a mathematics character (like {\≡\gamma≡\} or
{\≡\approx≡\}), or ``{\≡\char≡\}$\langle$number$\rangle$'', or ``{\≡{≡\}$\langle
$formula$\rangle${\≡}≡\}''. For example, ``{\≡\mathopen|≡\}'' denotes a
vertical line (absolute value bracket) treated as an Open box; and
$$\hbox{\≡\mathop{\char≡'155\char≡'141\char≡'170}≡\}$$
stands for the roman letters ``max'' in a size that varies with the math style.
Control sequences like {\≡\mathop≡\} are used mostly in definitions of other
control sequences for common idioms; for example, ``{\≡\max≡\}'' is defined
in Appendix B to be precisely the above sequence of symbols. Note that there's
no special control sequence to make a box ``ordinary''; you get an Ord box
simply by enclosing a formula in braces. For example, if you type ``{\≡{+}≡\}''
in a formula, the plus sign will be treated as an ordinary character like {\tt x}
for purposes of spacing. Another way to get the effect of ``{\≡{+}≡\}'' is to
type ``{\≡\char≡'53≡\}'', since characters entered with {\≡\char≡\} are
considered ordinary. \enddanger
\yskip{\bf$\underline{\hbox{5. Line
breakin}}$g$\underline.$\xskip}When you have formulas in a paragraph, \TEX\ may
have to break them between lines; it's something like hyphenation, a necessary evil
that is avoided unless the alternative is worse. Generally \TEX\ will break a
formula after a relation symbol like = or $<$ or $←$, or after a binary
operation symbol like $+$ or $-$ or $\times$, if these are on the ``outer level''
of the formula (not enclosed in {\≡{...}≡\} and not part of an ``{\≡\over≡\}''
construction). For example, if you type
$$\hbox{\≡$f(x,y) = x↑2-y↑2 = (x+y)(x-y)$≡\}$$
in mid-paragraph, there's a chance that \TEX\ will break after either of the
{\tt=} signs (it prefers this) or after the {\tt-} or
{\tt+} or {\tt-} (in an emergency).
Note that there won't be a break after the comma in any case---commas
after which breaks are desirable shouldn't ever appear between {\≡$≡\}'s.
If you don't want to permit breaking in this example except after the {\tt=}
signs, you could type
$$\hbox{\≡$f(x,y) = {x↑2-y↑2} = {(x+y)(x-y)}$≡\}.$$
But it isn't necessary to bother worrying about such things unless \TEX\
actually does break a formula badly, since the chances of this are
pretty slim.
\danger There's a ``discretionary hyphen'' allowed in formulas, but it means
multiplication: If you type ``{\≡$(x+y)\*(x-y)$≡\}'', \TEX\ will treat the
{\≡\*≡\} something like the way it treats {\≡\-≡\}; namely, a line break will be
allowed at that place, with the hyphenation penalty. However, instead of
inserting a hyphen, \TEX\ will insert a $\times$ sign in the current size.
\danger The penalty for breaking after a Rel box is 50, and the penalty for
breaking after a Bin box is 95. These penalties can be changed either by
typing ``{\≡\penalty≡\}$\langle$number$\rangle$'' immediately after the box in
question (thus changing the penalty in a particular case) or by using
{\≡\chpar≡\} as explained in Chapter 14 (thus changing the penalties applied
at {\sl all} subsequent
Rel and/or Bin boxes of math formulas enclosed in the current group).\enddanger
{\bf$\underline{\hbox{6. Elli}}$p\hskip-3pt$\underline{\hbox{\hskip3pt
ses \hskip 1.5pt}}$\hskip-1.5pt($
\underline{\hbox{``three dots''}}$)\hskip-1.5pt$\underline{\hbox{\hskip 1.5pt.}
}$\xskip}Mathematical copy looks much nicer if you
are careful about how ``three dots'' are typed in formulas and text. Although
it looks fine to type ``{\tt...}'' on a typewriter with fixed spacing, the
result looks too crowded when you're using a printer's fonts:
$$\hbox{``{\≡$x...y$≡\}''\qquad results in\qquad``$x...y$'',}$$
and such close spacing is undesirable except in subscripts or superscripts.
Furthermore there are two kinds of dots that can be used, one higher than the
other; the best mathematical traditions distinguish between these. It is
generally correct to produce formulas like
$$\hbox{$x↓1+\cdots+x↓n$\qquad and\qquad$(x↓1,\ldotss,x↓n)$,}$$
but wrong to produce formulas like
$$\hbox{$x↓1+\ldots+x↓n$\qquad and\qquad$(x↓1,\cdotss,x↓n)$.}$$
When using \TEX\ with the {\tt basic} control sequences in Appendix B, you
can solve the ``three dots'' problem in a simple way, and everyone will
be envious of the beautiful formulas you produce. There are five main
control sequences:
$$\vbox{\halign{#\qquad\hfill⊗#\hfill\cr
{\≡\ldots≡\}⊗three low dots ( $\ldots$ );\cr
{\≡\cdots≡\}⊗three center dots ( $\cdots$ );\cr
{\≡\ldotss≡\}⊗three low dots followed by a thin space;\cr
{\≡\cdotss≡\}⊗three center dots followed by a thin space;\cr
{\≡\ldotsm≡\}⊗three low dots preceded and followed by thin spaces.\cr}}$$
Of these, ``{\≡\cdots≡\}'' and ``{\≡\ldotss≡\}'' are the most commonly used,
as we shall see.
In general, it is best to use center dots between $+$ and $-$ signs, and also
between = signs or $≤$ signs or $←$ signs or other similar relational
operations. Lower dots are used between commas and when things are juxtaposed with
no signs at all. Here are the recommended rules for using the above control
sequences:
\yskip\hang\textindent{a)}Use {\≡\cdots≡\} between signs inside of a formula;
use {\≡\cdotss≡\} just before punctuation at the end of a formula.\xskip Examples:
``{\≡$x≡↓1=\cdots=x≡↓n=0$≡\}''; ``{\≡the infinite sum $y≡↓1+y≡↓2+\cdotss$≡\}.''.\!
\xskip
(The extra thin space in {\≡\cdotss≡\} will make the second example look better
than if {\≡\cdots≡\} had simply been used.)
\yskip\hang\textindent{b)}Use {\≡\ldotss≡\} before commas.\xskip
Example:$$\vbox{\halign{#\hfill\cr
{\≡The vector $(x≡↓1, \ldotss, x≡↓n)$ is composed≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ of the components $x≡↓1$,
$\ldotss$, $x≡↓n$.≡\}\cr}}$$ This example deserves careful study. Note that the
commas in the ``vector'' are part of the formula, but in the list of the
components they are part of the sentence. Note also that you must
be in math mode when using {\≡\ldotss≡\}.
\yskip\hang\textindent{c)}Use {\≡\ldotsm≡\} in ``multiplicative'' contexts,
i.e., when three dots are used with no surrounding operator sign.\xskip Examples:
$$\hbox{\≡$x≡↓1x≡↓2\ldotsm x≡↓n$≡\};\qquad
\hbox{\≡$(1-x)(1-x↑2)\ldotsm(1-x↑k)$≡\}.$$
Exception: Type ``{\≡$x↑1x↑2\ldotss x↑n$≡\}'', because this formula
when typeset ($\,x↑1x↑2\ldotss x↑n\,$) already has a ``hole'' at the
baseline after $x↑2$.
\yskip\hang\textindent{d)}Use {\≡\ldots≡\} in those comparatively rare cases
where you want three lower dots without a thin space before or after them.\xskip
Example: ``{\≡$(\ldots)$≡\}''.
\yskip\hang\textindent{e)}Use {\≡\cdotss≡\} between integral signs.\xskip
Example:$$\vbox{\halign{#\hfill\cr
{\≡$$\int≡↓0↑1\cdotss\int≡↓0↑1≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ f(x≡↓1,\ldotss,x≡↓n)\,dx≡↓1\ldotsm dx≡↓n.$$≡\}\cr}}$$
\hang\textindent{f)}Use ``{\≡$\ldotss\,$.≡\}'' when a sentence ends with
three lower dots.\xskip Example: ``{\≡The periodic sequence 0, 1, 0, 1, 0, 1,
$\ldotss\,$.≡\}''
\yyskip{\bf$\underline{\hbox{7. Handlin}}$g$\underline{\hbox{ vertical lines.}}
$}\xskip Besides the ``idioms'' represented by {\≡\cdots≡\} and {\≡\ldotss≡\},
there are a few other situations that can be typeset more beautifully with a
little care. A vertical line ``$|$'' and a double vertical line ``$\|$'' are
used for several different purposes in math formulas, and \TEX\ will sometimes
do a better job if you tell it what kind of a vertical line is meant. The
following control sequences will help you in this task:
$$\vbox{\halign{#\qquad\hfill⊗#\hfill\cr
{\≡\leftv≡\}⊗vertical line used as a left parenthesis;\cr
{\≡\rightv≡\}⊗vertical line used as a right parenthesis;\cr
{\≡\relv≡\}⊗vertical line used as a relation.\cr}}$$
For example, ``{\≡$$\leftv +x \rightv = \leftv -x \rightv$$≡\}'' specifies the
displayed equation
$$\leftv +x \rightv = \leftv -x \rightv\quad.$$
If this equation had been typed ``{\≡$$|+x|=|-x|$$≡\}'' the spacing would
have been quite wrong, namely
$$|+x|=|-x|\quad,$$
because the {\tt|}'s get the same spacing as ordinary variables like {\tt x}
when you haven't specified them to be {\≡\leftv≡\} or {\≡\rightv≡\} or {\≡\relv≡\}.
Compare also the following two formulas:
$$\vbox{\halign{#\hfill⊗\hskip40pt$#$\hfill\cr
{\≡$a|b$≡\}⊗a|b\quad;\cr
{\≡$a\relv b$≡\}⊗a\relv b\quad.\cr}}$$
There are three more control sequences {\≡\leftvv≡\}, {\≡\rightvv≡\}, and
{\≡\relvv≡\}, which do the same for double vertical lines.
\penalty-50 % desirable page break
Appendix B defines two control sequences of use when specifying formulas like
$$\leftset x\relv x≥5\rightset\quad.$$
The best way to type this is ``{\≡$$\leftset x \relv x≡≥5 \rightset$$≡\}'',
because {\≡\leftset≡\} and {\≡\rightset≡\} introduce braces with spacing to
match the spaces surrounding the {\≡\relv≡\}.
\yskip{\bf$\underline{\hbox{8. Number theor}}$y\hskip-3pt$
\underline{\hbox{\hskip3pt.}}$}\xskip
To specify a formula like ``$x\eqv y+1\mod{p↑2}$'', type ``{\≡$x\eqv
y+1\mod{p↑2}$≡\}'', using the control sequences {\≡\eqv≡\} and {\≡\mod≡\}
defined in Appendix B. Note that you don't type the parentheses in this
case; the control sequence provides them for you, with proper spacing
and line-breaking conventions.\xskip
(There is also a control sequence ``{\≡\neqv≡\}'' that
produces the inequivalence symbol ``$\neqv$''.) To specify the formula
$$\gcd(m,n)=\gcd(n\modop m,m)\quad,$$
type ``{\≡$$\gcd(m,n)=\gcd(n\modop m, m)$$≡\}'', using the control
sequences {\≡\gcd≡\} and {\≡\modop≡\}.\xskip (Actually this latter formula
would look slightly better if ``{\≡\,≡\}'' were inserted after the second comma.)
\yskip{\bf$\underline{\hbox{9. Matrices.}}$\xskip}Now comes the fun part.
Many different kinds of matrices are used in mathematics, and you can handle
them in \TEX\ by using the general alignment procedures we shall be studying
in a later chapter. For now, let's consider only simple cases. Suppose you
want to specify the formula
$$A=\left(\cpile{x-λ\cr 0\cr 0\cr}\quad\cpile{1\cr x-λ\cr 0\cr}\quad
\cpile{0\cr 1\cr x-λ\cr}\right)\quad;$$
here's how to do it:
$$\vbox{\halign{#\hfill\cr
{\≡$$A=\left(\vcenter{≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \halign{$\ctr{#}$\quad≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ⊗$\ctr{#}$\quad≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ⊗$\ctr{#}$\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ x-\lambda⊗1⊗0\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ 0⊗x-\lambda⊗1\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ 0⊗0⊗x-\lambda\cr}}\right)$$≡\}\cr}}$$
Explanation: We already know about ``{\≡\left(≡\}'' and ``{\≡\right)≡\}'',
which make the big parentheses that go around the matrix. The {\≡\vcenter≡\}
control sequence forms a box in restricted vertical mode, and centers that
box vertically so that the middle of the box is the same height as a minus
sign. The {\≡\halign≡\} control sequence is one of the things you can do in
restricted vertical mode; it is a general operator for producing aligned
tables. After ``{\≡\halign{≡\}'' and up to the first ``{\≡\cr≡\}'' is a
mysterious ritual for specifying three columns of a matrix.\xskip (We will learn
the rules of this later, let's take it on faith just now.)\xskip Then comes a
specification of the three matrix rows, with tab marks ``{\≡⊗≡\}'' between
columns, and with pseudo-carriage-returns ``{\≡\cr≡\}'' at the end of each row.\!
\xskip
(Here {\≡⊗≡\} is one of the special characters mentioned in Chapter 8, it is
not the $\langle$tab$\rangle$ key on your keyboard; similarly,
{\≡\cr≡\} is a control sequence, it is not \hbox{$\langle
$carriage-return$\rangle$}. Furthermore
{\≡\cr≡\} need not come at the end of a line; you can type
several rows of a matrix on a single line of your \TEX\ input manuscript.)\xskip
After the final {\≡\cr≡\} comes the ``{\≡}≡\}'' to end ``{\≡\halign{≡\}''; then
comes the ``{\≡}≡\}'' to end ``{\≡\vcenter{≡\}''. Finally the ``{\≡\right)≡\}''
finishes off the formula.
If there were five columns instead of three, the {\≡\halign≡\} specification
would be about the same, only longer; namely,
$$\vbox{\halign{#\hfill\cr
{\≡\halign{$\ctr{#}$\quad≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ⊗$\ctr{#}$\quad≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ⊗$\ctr{#}$\quad≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ⊗$\ctr{#}$\quad≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ⊗$\ctr{#}$\cr≡\}\cr}}$$
followed by the individual rows. Here {\≡\ctr≡\} means that the corresponding
column is to be centered; if you change it to {\≡\lft≡\} or {\≡\rt≡\}, the
entries in the corresponding column will be set flush left or flush right,
if they have different widths. When all matrix entries are numbers, it is
usually better to use {\≡\rt≡\} than {\≡\ctr≡\}.
The {\≡\quad≡\}s in the {\≡\halign≡\} ritual are used to specify the
space between columns. If you want twice as much space you can replace {\≡\quad≡\}
by {\≡\qquad≡\}.
\danger Another way to specify the matrix equation in the above example is
to use the {\≡\cpile≡\} control sequence of Appendix B for each column:
$$\vbox{\halign{#\hfill\cr
{\≡$$A=\left(\cpile{x-\lambda\cr 0\cr 0\cr}\quad≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \cpile{1\cr x-\lambda\cr 0\cr}\quad≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \cpile{0\cr 1\cr x-\lambda\cr}\right)$$≡\}\cr}}$$
However, this use of {\≡\cpile≡\} is {\sl not} recommended, because it doesn't
work in general: Each column is being typeset independently as a
separate {\≡\cpile≡\}, so the rows won't line up properly if some matrix entries
are taller than others. It's best to use {\≡\halign≡\} as suggested above---those
funny-looking column format specifications are scary only the first few times
you encounter them; afterwards they are quite simple to use. On the other
hand {\≡\cpile≡\} (and its cousins {\≡\lpile≡\} and {\≡\rpile≡\}, which
produce left-justified and right-justified columns of formulas just as {\≡\cpile≡\}
produces centered columns) can be handy in simple cases.
\danger How about matrices involving {\≡\ldots≡\}? The following example should
help you answer this question. Suppose you want to specify the matrix
$$\left(\vcenter{\halign{\ctr{$#\;$}⊗\ctr{$#\;$}⊗\ctr{$#\;$}⊗$\ctr{#}$\cr
a↓{11}⊗a↓{12}⊗\ldots⊗a↓{1n}\cr
a↓{21}⊗a↓{22}⊗\ldots⊗a↓{2n}\cr
\vdots⊗\vdots⊗ ⊗\vdots\cr
a↓{m1}⊗a↓{m2}⊗\ldots⊗a↓{mn}\cr}}\right)\quad.$$
One way to do it, using the ``{\≡\vdots≡\}'' control sequence of Appendix B, is
$$\vbox{\halign{#\hfill\cr
{\≡$$\left(\vcenter{\halign{$\ctr{#}\;$\!≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ⊗$\ctr{#}\;$⊗$\ctr{#}\;$⊗$\ctr{#}$\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ a≡↓{11}⊗a≡↓{12}⊗\ldots⊗a≡↓{1n}\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ a≡↓{21}⊗a≡↓{22}⊗\ldots⊗a≡↓{2n}\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \vdots⊗\vdots⊗ ⊗\vdots\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ a≡↓{m1}⊗a≡↓{m2}⊗\ldots⊗a≡↓{mn}\cr}}\right)$$≡\}\cr}}\quad.$$
\danger Long ago in this chapter you were promised a solution to the problem
of typing a displayed equation such as
{\tenpoint
$$|x|=\left\{\vcenter{\halign{\lft{$#$,}\qquad⊗if \lft{$#$}\cr x⊗x≥0;\cr-x⊗x<0.\cr}}
\right.$$}
Here it is, using {\≡\vcenter≡\} and {\≡\halign≡\}; see if you can understand
it now:
$$\vbox{\halign{#\hfill\cr
{\≡$$\leftv x \rightv = \left\{\vcenter{≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \halign{\lft{$#$,}\qquad≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ⊗if \lft{$#$}\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ x⊗x≡≥0;\cr -x⊗x<0.\cr}}\right.$$≡\}\cr}}$$
Note that the commas and ifs are generated by the {\≡\halign≡\} specification; this
trick isn't necessary, but it saves some typing.
Another solution could be devised using {\≡\lpile≡\}, but (as in the discussion
of matrices above) it is not recommended.\enddanger
\noindent\exno 18.3: Explain how to type
$${1\over2\pi}\int↓{-∞}↑{\sqrt y}\bigglp\sum↓{k=1}↑n\sin↑2x↓k(t)\biggrp
\biglp f(t)+g(t)\bigrp\,dt.$$
\exno 18.4: Also explain how to type
$${(n↓1+n↓2+\cdots+n↓m)!\over n↓1!\,n↓2!\ldotsm n↓m!}={n↓1+n↓2\choose n↓2}
{n↓1+n↓2+n↓3\choose n↓3}\ldotsm{n↓1+n↓2+\cdots+n↓m\choose n↓m}.\hskip-1pt$$
\danger \exno 18.5: How can you get \TEX\ to typeset the column vector
$\left(\cpile{y↓1\cr\vdots\cr y↓k\cr}\right)$\quad?
\danger \exno 18.6: Using Appendix F to find the names of special characters,
explain how to type
\tenpoint
$$\Pscr↓{Lhj}(x)=\hbox{Tr}\left[{\partial F↓{L↑{-1}}\over\partial t↓h}
\chi(L)\Mscr↓{nj}(x)\right],\qquad\hbox{evaluated at }\chi(\Gamma)\modop
\hbox{\sl SL}(n,\hbox{\bf C}).$$
\danger \exno 18.7: Define a control sequence {\≡\e≡\} for the ``colon-equal''
operator in computer science, so that a formula like ``$x\mathrel{\char'72
\char'75}2\times x+1$'' will be properly spaced after it has been typed
``{\≡$x\e2\times x+1$≡\}''.
\chapterbegin 19. {Displayed equations}
By now you know how to type mathematical formulas so that \TEX\ will handle
them with supreme elegance; but there is one more aspect of the art of mathematical
typing that we should discuss. Namely, displays.
As mentioned earlier, you can type ``{\≡$$≡\}$\langle$formula$\rangle${\≡$$≡\}''
to display a formula in flamboyant display style. Another thing you can do is
type
$$\hbox{{\≡$$≡\}$\langle$formula$\rangle${\≡\eqno≡\}$\langle$formula$\rangle
${\≡$$≡\}\quad;}$$
this displays the first formula and also puts an equation number (the second
formula) at the right-hand margin. For example,
$$\hbox{\≡$$x↑2-y↑2 = (x+y)(x-y).\eqno(15)$$≡\}$$
will produce this:
$$x↑2-y↑2 = (x+y)(x-y).\eqno(15)$$
\vskip-6pt
\danger Here's what {\≡$$≡\} and {\≡\eqno≡\} do, in more detail:
The formula to be displayed is made into a box using display style (unless you
override the style). If {\≡\eqno≡\} appears, the formula following it is
made into a box using text style. When the combined width of these two boxes,
plus one text size quad, exceeds the current line width, squeezing is
attempted as follows: If the shrinkability of the formula to be displayed
would allow it to fit, the formula is repackaged into a box that has just
enough width; otherwise the formula is repackaged into a box having the current
line width, and the equation number (if any) will be
placed on a new line just below the formula box. The formula to be displayed
is centered on the line, where this centering is independent of the width of the
equation number, {\sl unless} this would leave less space between the formula
and the equation number than the width of the equation number itself; in the
latter case, the formula is placed flush left on the line. Now \TEX\ looks
at the length of the previous line of the current paragraph: if this is short
compared to the size of the displayed equation, vertical glue that the
designer has specified by ``{\≡\dispaskip≡\}$\langle$glue$\rangle$'' will
be placed above the formula, and vertical glue specified by
``{\≡\dispbskip≡\}$\langle$glue$\rangle$'' will be placed below. Otherwise
vertical glue specified by ``{\≡\dispskip≡\}$\langle$glue$\rangle$'' will
be placed both above and below.\xskip (The glue below is, however, omitted
if an equation number has to be dropped down to a separate line; this separate
line takes the place of the glue that ordinarily would have appeared.)
\danger Another thing you can type for displays, when you know what you're
doing, is ``{\≡$$\halign≡\}$\langle$spec$\rangle${\≡{≡\}$\langle$alignment$\rangle
${\≡}$$≡\}''. This is just like an ordinary {\≡\halign≡\}, except that the
{\≡$$≡\}'s interrupt a paragraph and insert {\≡\dispskip≡\} glue above and
below the aligned result. Note that {\≡\eqno≡\} cannot be used in this case,
and no automatic centering is done. Page breaks might occur in the midst
of such displays.\enddanger
OK, the use of displayed formulas is very nice, but when you try typing
a lot of manuscripts you will run into some displays that don't fit the
simple pattern of a single formula with or without an equation number.
Appendix B defines special control sequences that will cover most of the
remaining cases:
{\bf\yskip\textindent{1.}Two or more equations that should be aligned on = signs.}\!
\xskip
(The alignment can also be on other signs like $≤$, etc.)\xskip For this case, type
$$\vbox{\halign{#\hfill\cr
{\≡$$\eqalign{≡\}$\langle$left-hand side$↓1\rangle${\≡⊗≡\}$\langle$right-hand
side$↓1\rangle${\≡\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡\}$\langle$left-hand side$↓2\rangle${\≡⊗≡\}$\langle
$right-hand side$↓2\rangle${\≡\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡\}$\vdots$\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡\}$\langle$left-hand side$↓n\rangle${\≡⊗≡\}$\langle
$right-hand side$↓n\rangle${\≡\cr}$$≡\}\cr}}$$
with an optional {\≡\eqno≡\}$\langle$formula$\rangle$ just before the closing
``{\≡$$≡\}'' and after the closing ``{\≡\cr}≡\}''. {\sl N.B.: Don't forget
to type the final {\≡\cr≡\}!}\/\ The relation symbols on which you are aligning
should be the first symbols of the right-hand sides (not the last symbols
of the left-hand sides). If {\≡\eqno≡\} appears, the equation number
will be centered vertically
in the display (or---if it doesn't fit---it will be dropped down to the line
following the display, as mentioned earlier). For example, if you type
$$\vbox{\halign{#\hfill\cr
{\≡$$\eqalign{a≡↓1+b≡↓1w+c≡↓1w↑2⊗=\alpha+\beta;\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡≡ ≡ ≡ ≡ ≡ ≡ ≡ b≡↓2x+c≡↓2x↑2⊗= 0.\cr}\eqno(30)$$≡\}\cr}}$$
the result will be
$$\eqalign{a↓1+b↓1w+c↓1w↑2⊗=\alpha+\beta;\cr
b↓2x+c↓2x↑2⊗= 0.\cr}\eqno(30)$$
Note that the left-hand sides are right-justified and the right-hand sides are
left-justified, so the = signs line up; the whole formula is also centered,
and the equation number (30) is halfway between the lines.
\danger Sometimes you may want more or less vertical space between the aligned
equations. Type ``{\≡\noalign{\vskip≡\}$\langle$glue$\rangle${\≡}≡\}'' after
any {\≡\cr≡\}, to insert a given amount of extra glue after any particular
equation line.\xskip (You can even do this before the first equation and after
the last one.)
\danger In general, the result of {\≡\eqalign≡\} is a {\≡\vcenter≡\}ed
box, so {\≡\eqalign≡\} can be used in a fashion analogous to {\≡\lpile≡\} or
{\≡\cpile≡\}. Thus, it is
possible to type such things as ``{\≡$$\eqalign{...} \qquad
\eqalign{...}$$≡\}'', obtaining a display with two columns of
aligned formulas. \enddanger
{\bf\textindent{2.}Two or more equations that should be aligned, some of which
have equation numbers.} For this case you use {\≡\eqalignno≡\}, which is something
like {\≡\eqalign≡\}, but each line now has the form
$$\langle\hbox{left-hand side}\rangle\hbox{\≡⊗≡\}\langle\hbox{right-hand side}
\rangle\hbox{\≡⊗≡\}\langle\hbox{equation number}\rangle\hbox{\≡\cr≡\}\quad.$$
For example,
$$\vbox{\halign{#\hfill\cr
{\≡$$\eqalignno{a≡↓1+b≡↓1w+c≡↓1w↑2⊗=\alpha+\beta;⊗(29)\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡≡ ≡ ≡ ≡ ≡ ≡ ≡ b≡↓2x+c≡↓2x↑2⊗=0.⊗(30)\cr}$$≡\}\cr}}$$
yields
$$\eqalignno{a↓1+b↓1w+c↓1w↑2⊗=\alpha+\beta;⊗(29)\cr
b↓2x+c↓2x↑2⊗= 0.⊗(30)\cr}$$
You can't use {\≡\eqno≡\} together with {\≡\eqalignno≡\}; the equation numbers
now must appear as shown.
If the $\langle$equation number$\rangle$ of some line is blank, you can omit
the {\≡⊗≡\} before it. Example:
$$\vbox{\halign{#\hfill\cr
{\≡$$\eqalignno{f(x)⊗=(x-1)(x+1)\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ⊗=x↑2-1.⊗(31)\cr}$$≡\}\cr}}$$
This will produce the following display:
$$\eqalignno{f(x)⊗=(x-1)(x+1)\cr
⊗=x↑2-1.⊗(31)\cr}$$
(Note the position of the equation number.)
\danger You can use
{\≡\noalign≡\} within {\≡\eqalignno≡\}
to insert new lines of text. For example, ``{\≡\noalign{≡!
\hbox{implies}}≡\}'' will insert a line containing the word ``implies''
(at the left margin) between two aligned formulas.\enddanger
{\bf\yskip\textindent{3.}A long equation that must be broken into two lines.}
You may want to type this as
$$\hbox{{\≡$$\twoline{≡\}$\langle$first line$\rangle${\≡}{≡\}$\langle$glue$\rangle
${\≡}{≡\}$\langle$second line$\rangle${\≡}$$≡\}}\quad.$$
The formula's first line will be moved to the left so that
it is one text size quad from the left margin, and its second line will be moved
to the right so that it is one text size quad from the right margin. The specified
glue will be inserted between these two lines in addition to the normal glue.
Another way to break a long equation is to use {\≡\eqalign≡\} with appropriate
quads inserted at the beginning of the second line.
For example, here's an equation that is clearly too big to fit:
$$\hskip 0pt minus 1000pt
\sigma(2↑{34}-1,2↑{35},1)=-3+(2↑{34}-1)/2↑{35}+2↑{35}/(2↑{34}-1)+7/2↑{35}(2↑{34}-1)
-\sigma(2↑{35},2↑{34}-1,1).\hskip 0pt minus 1000pt$$
Let's break it just before the ``$\null+7$''. One way to do this is to type
$$\vbox{\halign to size{\hskip 25pt#\hfill\tabskip0ptplus100pt\cr
{\≡$$\twoline{\sigma(2↑{34}-1,2↑{35},1)=-3+(2↑{34}-1)/≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ 2↑{35}+2↑{35}/(2↑{34}-1)}{2pt}{\null+7/2↑≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ {35}(2↑{34}-1)-\sigma(2↑{35},2↑{34}-1,1).}$$≡\}\cr}}$$
The two-line result will then be
$$\twoline{\sigma(2↑{34}-1,2↑{35},1)=-3+(2↑{34}-1)/2↑{35}+
2↑{35}/(2↑{34}-1)}{0pt}{\null+7/2↑{35}(2↑{34}-1)
-\sigma(2↑{35},2↑{34}-1,1).}$$
The other alternative is to type
$$\vbox{\halign to size{\hskip 25pt#\hfill\tabskip0ptplus100pt\cr
{\≡$$\eqalign{\sigma(2↑{34}-1,2↑{35},1)⊗=-3+(2↑{34}-1)/≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ 2↑{35}+2↑{35}/(2↑{34}-1)\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ⊗\qquad\null+7/2↑{35}(2↑{34}-1)≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ -\sigma(2↑{35},2↑{34}-1,1).\cr}$$≡\}\cr}}$$
which yields
$$\eqalign{\sigma(2↑{34}-1,2↑{35},1)⊗=-3+(2↑{34}-1)/2↑{35}+
2↑{35}/(2↑{34}-1)\cr
⊗\qquad\null+7/2↑{35}(2↑{34}-1)
-\sigma(2↑{35},2↑{34}-1,1).\cr}$$
A couple of things should be explained and emphasized about this example:\xskip
(a) The second line starts with ``{\≡\null+7≡\}'' instead of just ``{\tt+7}''.
The control sequence {\≡\null≡\} is defined in Appendix B to mean a box of
size zero, containing nothing,
and this may seem rather insignificant; but it makes a big difference
to \TEX, because a plus sign in the middle of a formula is followed by a
space, but a plus sign that begins a formula is not. Thus, you should always
remember to type ``{\≡\null≡\}'' when you are continuing a multi-line formula.\xskip
(b) When you use {\≡\twoline≡\}, never hit \hbox{$\langle$carriage-return$\rangle$}
on your keyboard just after the {\≡}≡\} that follows the $\langle$first line$
\rangle$, or just after the {\≡}≡\} that follows the $\langle$glue$\rangle$;
this \hbox{$\langle$carriage-return$\rangle$} makes \TEX\ think a space was
intended, and {\≡\twoline≡\} won't work correctly.\xskip (You'll probably get some
inscrutable error message like ``{\≡\halign in display math mode must be
followed by $$.≡\}'')
Breaking of long displayed formulas into several lines is an art; \TEX\ never
attempts to do it, because no set of rules is really adequate. The author
of a mathematical manuscript should really decide how all such formulas should
break, since the break position depends on subtle factors of mathematical
exposition. Furthermore, different publishers tend to have different styles for
line breaks. But several rules of thumb can be stated, since they
seem to reflect the best mathematical practice:
\yskip\hang\textindent{a)}Although formulas within a paragraph always
break {\sl after}
binary operations and relations, displayed formulas always break {\sl before}
binary operations and relations. Thus, we didn't end the first line of the
above example with ``{\≡(2↑{34}-1)+\null≡\}'', we ended it with
``{\≡(2↑{34}-1)≡\}'' and began the second line with ``{\≡\null+7≡\}''.
\yskip\hang\textindent{b)}The {\≡\twoline≡\} form is generally preferable for
equations with a long left-hand side; then the break usually comes just before
the = sign.
\yskip\hang\textindent{c)}When an equation is broken before a binary operation,
the second line should start at least two quads to the right of where the
innermost subformula containing that binary operation begins on the first line.
For example, if you wish to break
$$\hbox{{\≡$$\sum≡↓{1≡≤k≡≤n}\left(≡\}$\langle$formula$↓1\rangle${\tt+}$\langle
$formula$↓2\rangle${\≡\right)$$≡\}}$$
at the plus sign between $\langle$formula$↓1\rangle$ and $\langle$formula$↓2
\rangle$, it is almost mandatory to have the plus sign on the second line
appear somewhat to the right of the large left parenthesis corresponding to
``{\≡\left(≡\}''. [Note further that your uses of {\≡\left≡\} and {\≡\right≡\}
must balance in both parts of the broken formula. You could type, for instance,
$$\vbox{\halign to 27pc{\hskip 25pt#\hfill\tabskip0ptplus100pt\cr
{\≡\eqalign{\sum≡↓{1≡≤k≡≤n}⊗\left(≡\}$\langle$formula$↓1\rangle${\≡\right.\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ⊗\qquad\left.\null+≡\}$\langle$formula$↓2\rangle
${\≡\right)$$≡\}\cr}}$$
provided that $\langle$formula$↓1\rangle$ and $\langle$formula$↓2\rangle$ are both
of the same height and depth so that the {\≡\left(≡\} on the first line will
turn out to be the same size as the {\≡\right)≡\} on the second. But in such cases
it's simpler and safer to use, e.g., {\≡\bigglp≡\} and {\≡\biggrp≡\} instead of
{\≡\left(≡\} and {\≡\right)≡\}.]
\chapterbegin 20. {Definitions (also called macros)}
You can often save time typing math formulas by defining control sequences as
abbreviations for constructions that occur frequently in a particular manuscript.
For example, if some manuscript frequently refers to the vector ``$(x↓1,\ldotss,
x↓n)$'', you can type
$$\hbox{\≡\def\xvec{(x≡↓1,\ldotss,x≡↓n)}≡\}$$
and {\≡\xvec≡\} will henceforth be an abbreviation for
``{\≡(x≡↓1,\ldotss,x≡↓n)≡\}''. Formulas like
$$\def\xvec{(x↓1,\ldotss,x↓n)}
\sum↓{\xvec≠(0,\ldotss,0)}\biglp f\xvec+g\xvec\bigrp$$
can then be typed simply as
$$\hbox{\≡$$\sum≡↓{\xvec≡spose/=(0,\ldotss,0)}\biglp
f\xvec+g\xvec\bigrp$$≡\}\quad.$$
\danger \TEX's definition facility is what a designer uses to define all the
standard formats, so Appendices B and E contain many illustrations of the use of
{\≡\def≡\}. For example, {\≡\eqalign≡\} and {\≡\eqalignno≡\} are both defined
in Appendix B. Defined control sequences can be followed by arguments, so we shall
study the general rules for such definitions in this chapter. It's a good idea for
you to look at Appendix B now.
\danger The general form is ``{\≡\def≡\}$\langle$controlseq$\rangle\langle$parameter
text$\rangle${\≡{≡\}$\langle$result text$\rangle${\≡}≡\}'', followed by an
optional space, where the $\langle$parameter text$\rangle$ contains no {\≡{≡\}
or {\≡}≡\}, and where all occurrences of {\≡{≡\} and {\≡}≡\} in the $\langle$result
text$\rangle$ are properly nested in groups. Furthermore the {\≡#≡\} symbol
(or whatever symbol is being used to stand for parameters, cf.\ Chapter 7) has
a special significance: In the $\langle$parameter text$\rangle$, the first
appearance of {\≡#≡\} must be followed by {\tt1}, the next by {\tt2}, and so on;
up to nine {\≡#≡\}'s are allowed. In the $\langle$result text$\rangle$ each
{\≡#≡\} must be followed by a digit that appeared after {\≡#≡\} in the $\langle
$parameter text$\rangle$, or else the {\≡#≡\} should be followed by another
{\≡#≡\}. The latter case stands for insertion of a single {\≡#≡\} in the result
of any use of the definition;
the former case stands for insertion of the corresponding argument.
\danger For example, let's consider a ``random'' definition that doesn't do anything
useful except that it does exhibit \TEX's rules. The definition
$$\hbox{\≡\def\cs AB#1#2CD\$E#3 {#3{ab#1}#1 c\x ###2}≡\}$$
says that the control sequence {\≡\cs≡\} is to have a parameter text consisting
of ten tokens
$$\hbox{\tt A},\quad\hbox{\tt B},\quad\hbox{\≡#1≡\},\quad\hbox{\≡#2≡\},\quad
\hbox{\tt C},\quad\hbox{\tt D},\quad\hbox{\≡\$≡\},\quad\hbox{\tt E},\quad
\hbox{\≡#3≡\},\quad\hbox{\tt\char'40},$$
and a result text consisting of twelve tokens
$$\hbox{\≡#3≡\},\quad\hbox{\≡{≡\},\quad\hbox{\tt a},\quad\hbox{\tt b},\quad
\hbox{\≡#1≡\},\quad\hbox{\≡}≡\},\quad\hbox{\≡#1≡\},\quad\hbox{\tt\char'40},\quad
\hbox{\tt c},\quad\hbox{\≡\x≡\},\quad\hbox{\≡#≡\},\quad\hbox{\≡#2≡\}.$$
Henceforth when \TEX\ reads the control sequence {\≡\cs≡\} it expects that the next
two input tokens will be {\tt A} and {\tt B} (otherwise you will get the error
message ``{\≡Use of \cs doesn't match its definition≡\}''); then comes argument
{\≡#1≡\}, then argument {\≡#2≡\}, then {\tt C}, then {\tt D}, then {\≡\$≡\}, then
{\tt E}, then argument {\≡#3≡\}, and finally a space.\xskip (It is customary to
use the word ``argument''
to mean the string of tokens that gets substituted for a parameter; parameters
appear in a definition, and arguments appear when that definition is used.)
\danger How does \TEX\ determine where an argument stops, you ask. Answer: If
a parameter is followed in the definition by another token,
the corresponding argument is the shortest (possibly empty) sequence of tokens with
properly nested {\≡{...}≡\} groups that is followed in the input by this particular
token. Otherwise the corresponding argument is the shortest {\sl nonempty} sequence
of tokens with properly nested {\≡{...}≡\} groups; namely, it is the next token,
unless the token is {\≡{≡\}, when the argument is an entire group. In any case,
if the argument found in this way has the form ``{\≡{≡\}$\langle$balanced tokens$
\rangle${\≡}≡\}'', where $\langle$balanced tokens$\rangle$ stands for a sequence of
tokens that is properly nested with respect to {\≡{≡\} and {\≡}≡\}, the
outermost {\≡{≡\} and {\≡}≡\} enclosing this argument are removed. For example,
let's continue with {\≡\cs≡\} as defined above, and suppose that the subsequent
input contains
$$\hbox{\≡\cs AB{\Look}ABCD\$ E{And }{look} F.≡\}$$
Argument {\≡#1≡\} will be the token {\≡\Look≡\}, since {\≡#1≡\} is immediately
followed by {\≡#2≡\} in the definition, and since {\≡{\Look}≡\} is the shortest
acceptable sequence of tokens
following ``{\≡\cs AB≡\}''. Argument {\≡#2≡\} will be the
two tokens ``{\tt AB}'', since it is to be followed by ``{\tt C}''. Argument
{\≡#3≡\} will be the twelve tokens ``{\≡{And }{look}≡\}'', since it is to be
followed by a space. Note that the exterior {\≡{≡\} and {\≡}≡\} are not removed
from {\≡#3≡\} as they were from {\≡#1≡\}, since that would leave an unnested
string ``{\≡And }{look≡\}''. Note also that the space following ``{\≡\$≡\}'' is
ignored since it isn't really a space (it follows a control sequence). The net
effect then, after substituting arguments for parameters in the result text,
will be that \TEX's input will essentially become
$$\hbox{\≡{And }{look}{ab\Look}\Look≡char'40c\x#ABF.≡\}$$
The space {\tt\char'40} here {\sl will} be digested, even though it follows
the control sequence {\≡\Look≡\}, because it was part of the defined result
text. The ``{\tt F.}'' here comes from the yet-unscanned input.
\danger Definitions are not ``expanded'' (i.e., replaced by the result
text) when they occur in a {\≡\def≡\} or an argument.
Thus {\≡\Look≡\} and {\≡\$≡\} and {\≡\x≡\} are treated as single tokens
in the example above, even though {\≡\Look≡\} has presumably
been defined elsewhere. If {\≡⊗≡\} or {\≡\cr≡\} occurs
without being enclosed in {\≡{...}≡\}, in a definition or an argument
in the midst of an alignment,
\TEX\ assumes that this {\≡⊗≡\} or {\≡\cr≡\} belongs to the alignment and
not to the definition or argument.
\danger If you have difficulty understanding why some {\≡\def≡\} doesn't work as
you expected, try running your program with {\≡\trace≡'355≡\} (see Chapter
27).
\danger The effect of {\≡\def≡\} lasts only until the control sequence is redefined
or until the end of the group containing that {\≡\def≡\}. But there is another
control sequence {\≡\gdef≡\} that makes a ``global'' definition, i.e., it
defines a control sequence valid in all\eject % desirable page break (Feb 22 '79)
groups unless redefined. The {\≡\gdef≡\}
instruction is especially useful in connection within {\≡\output≡\} routines,
as explained in Chapter 23.
\danger \exno 20.1: The example definition of {\≡\cs≡\} includes a {\≡##≡\} in
its result text, but the way {\≡##≡\} is actually used in that example is
rather pointless. Give an example of a definition where {\≡##≡\} serves
a useful purpose.
\chapterbegin 21. {Making boxes}
In Chapters 11 and 12 we discussed the idea of boxes and glue; now it is
time to study the various facilities \TEX\ has for making various kinds of
boxes. In most cases, you can get by with boxes that \TEX\ manufactures
automatically with its paragraph builder, page builder, and math formula
processor; but if you want to do nonstandard things, you have the option
of making boxes by yourself.
\danger To make a rule box, type ``{\≡\hrule≡\}'' in vertical mode or
``{\≡\vrule≡\}'' in
horizontal mode, followed if desired by any or all of the specifications
``{\tt width}$\langle$dimen$\rangle$'', ``{\tt height}$\langle$dimen$\rangle$'',
``{\tt depth}$\langle$dimen$\rangle$'', in any order. For example, you can type
``{\≡\vrule height 4pt width 3pt depth 2pt≡\}'' in the middle of a paragraph,
and you will get the black box ``\vrule height 4pt width 3pt depth 2pt''.
The dimensions you specify should not be negative. If you leave any dimensions
unspecified, you get the following by default:
$$\vbox{\halign{\hfill#⊗\qquad\hfill#\hfill\qquad⊗\hfill#\hfill\cr
⊗{\≡\hrule≡\}⊗{\≡\vrule≡\}\cr
width⊗{\tt*}⊗0.4 pt\cr
height⊗0.4 pt⊗{\tt *}\cr
depth⊗0.0 pt⊗{\tt*}\cr}}$$
(Here ``{\tt*}'' means that the rule will extend to the boundary of the smallest
enclosing box.)
\danger To make a box from a horizontal list of boxes, type ``{\≡\hbox{≡\}$\langle
$hlist$\rangle${\≡}≡\}'', where $\langle$hlist$\rangle$ specifies the
list of boxes in restricted horizontal mode. For example, ``{\≡\hbox{This is
not a box}≡\}'' makes the box
\def\boxit#1{\vbox{\hrule\hbox{\vrule\vbox{#1}\vrule}\hrule}}
$$\vcenter{\boxit{\hbox{This is not a box}}}$$
(in spite of what it says). The boundary lines in this illustration aren't typeset,
of course; they merely indicate the box's actual extent, as determined by the rules
of Chapters 11 and 12.
\danger Similarly, the instruction
``{\≡\vbox{≡\}$\langle$vlist$\rangle${\≡}≡\}'' makes a box
from a {\sl vertical} list of boxes. If you type
$$\vbox{\halign{#\hfill\cr
{\≡\vbox{\hbox{T}\hbox{h}\hbox{i}\hbox{s}≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ \hbox{ }\hbox{b}\hbox{o}\hbox{x}}≡\}\cr}}$$
you will get this box:
$$\vcenter{\boxit{\vbox{\hbox{T}\hbox{h}\hbox{i}\hbox{s}\hbox{ }\hbox{b}
\hbox{o}\hbox{x}}}}$$
Automatic baseline adjustment is done on vertical lists, as explained in
Chapter 15. The following example shows what happens if the baseline adjustment
is varied:
$$\vcenter{\halign{#\hfill\cr
{\≡\vbox{\def\\#1{\hbox{#1}}≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ \baselineskip-1pt≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ \lineskip 3pt≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ \\T\\h\\i\\s≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ \\{}\\b\\o\\x}≡\}\cr}}
\hskip 100pt \vcenter{\boxit{
\vbox{\def\\#1{\hbox{#1}}
\baselineskip-1pt
\lineskip 3pt
\\T\\h\\i\\s
\\{}\\b\\o\\x}
}}$$
Note that a specially defined control sequence {\≡\\≡\} saves a lot of typing
in this example.
\danger \exno 21.1: When
the author of this manual first prepared the above example, he
wrote ``{\≡\baselineskip 0pt≡\}'' instead of ``{\≡\baselineskip-1pt≡\}''. Why
didn't this work?
\danger\exno 21.2: How
would you change the above example so that the
letters are {\sl centered} with respect to each other, instead of
being placed flush left?
\danger The phrase ``list of boxes'' in the above discussion really means a
list of boxes and glue. But if {\≡\hbox≡\} and {\≡\vbox≡\} are used in the
simple manner stated, the glue does not stretch or shrink. When you want the
glue to do its thing, type ``{\≡\hbox to ≡\}$\langle$dimen$\rangle${\≡{≡\}$
\langle$hlist$\rangle${\≡}≡\}''
and you will get a box of the specified width; or type
``{\≡\vbox to ≡\}$\langle$dimen$\rangle${\≡{≡\}$\langle$vlist$\rangle${\≡}≡\}''
and you will get a box of the specified height.\xskip (The depth of a {\≡\vbox≡\}ed
box is always the depth of the last box in the vertical list, except that it is
zero when glue follows the last box.)\xskip You may also type
``{\≡\hbox to size{≡\}$\langle$hlist$\rangle${\≡}≡\}'' or
``{\≡\vbox to size{≡\}$\langle$vlist$\rangle${\≡}≡\}''; this means that the
$\langle$dimen$\rangle$ is to be the most recently specified {\≡\hsize≡\} or
{\≡\vsize≡\}, respectively. Finally, there's a further option of typing
``{\≡\hbox expand ≡\}$\langle$dimen$\rangle${\≡{≡\}$\langle$hlist$\rangle
${\≡}≡\}'' or ``{\≡\vbox expand ≡\}$\langle$dimen$\rangle${\≡{≡\}$\langle$vlist$
\rangle${\≡}≡\}'';
these expand the box to its natural width or height plus the (possibly negative)
amount specified.
\danger You can also get the effect of paragraphing and line-breaking with
{\≡\hbox≡\}, in the following way: If you give the instruction ``{\≡\hbox par≡\}
$\langle$dimen$\rangle$'', \TEX\ will use its
paragraph line-breaking routine to convert the horizontal list into one or
more lines of the specified width. In this case the {\≡\hbox≡\} will actually
result in a box formed from a {\sl vertical} list of horizontal lists of
the desired width. The boxed paragraph that you get is not indented.
$$\hbox par 156pt{For example, the box that you are now
reading was made by typing ``{\≡\hbox
par 156pt{For example, the box≡\}\break
$\ldots$\xskip {\≡five lines.}≡\}'' and \TEX\ broke it
into five lines.}$$
\danger If you specify hanging indentation with such a boxed paragraph, it applies
to the box and not to the paragraph (if any) containing the box. For example,
$$\hbox{{\≡\hbox par 200pt{\hangindent 10 pt ≡\}$\langle$ text $\rangle$ {\≡}≡\}}$$
will put the specified text into a box 200 points wide, where all lines after
the first are indented by 10 points at the left. However, all other parameters
affecting the setting of the boxed paragraph (the baseline skip, raggedness, etc.)
should be set up {\sl before} the {\≡\hbox par≡\}.
\danger You can save a constructed
box for later use by typing ``{\≡\save≡\}$\langle$digit$
\rangle\langle$box$\rangle$, where $\langle$digit$\rangle$ is {\tt0} or {\tt1}
or $\cdots$ or {\tt9} and $\langle$box$\rangle$ specifies a box. For example,
``{\≡\save3\hbox≡penalty0{The formula ≡`≡`$x+y$≡'≡'.}≡\}'' will save away the box
$$\vcenter{\tenpoint\boxit{\hbox{The formula ``$x+y$''.}}}$$
(Note that math formulas are allowed in $\langle$hlist$\rangle$s; but displays
are not.)\xskip
Later you can use this saved box by typing ``{\≡\box≡\}$\langle$digit$
\rangle$''. The {\≡\save≡\} and {\≡\box≡\} instructions are useful for constructing
rather complex layouts like those in a newspaper page. Caution: You can use a
saved box only once; after you type ``{\≡\box3≡\}'' the contents of box 3 becomes
null. If you type ``{\≡\save3\box2≡\}'' the effect is to move box 2 to box 3
and then to make box 2 empty.
\save4\hbox par 300pt{\exno 21.3: Define a control
sequence {\≡\boxit≡\} so that ``{\≡\boxit{≡\}$\langle$box$\rangle${\≡}≡\}''
yields the given box surrounded by 3 points of space and ruled lines on all
four sides. For example, this exercise has been typeset by telling \TEX\ to
{\≡\boxit{\boxit{\box4}}≡\}, where box 4 was created by typing ``{\≡\save4\hbox
par 300pt{\exno 21.3: Define ...}≡\}''.}
\def\boxit#1{\vbox{\hrule
\hbox{\vrule\hskip 3pt\vbox{\vskip 3pt #1 \vskip 3pt}\hskip 3pt\vrule}
\hrule}}
\danger \lower 55pt\boxit{\boxit{\box4}}
\danger To raise or lower a constructed
box in a horizontal list, or in a math formula,
precede it by ``{\≡\raise≡\}$\langle$dimen$\rangle$'' or
``{\≡\lower≡\}$\langle$dimen$\rangle$''. For example, the {\≡\TEX≡\} control
sequence that prints the \TEX\ logo in this manual is defined by
$$\hbox{\≡\def\TEX{\hbox{\:aT\hskip-2pt\lower1.94pt\hbox{E}\hskip-2pt X}}≡\}$$
Similarly, you can move a constructed
box left or right in a vertical list if you type
``{\≡\moveleft≡\}$\langle$dimen$\rangle$''
or ``{\≡\moveright≡\}$\langle$dimen$\rangle$'' just before its description.
The control sequences {\≡\vcenter≡\} and {\≡\vtop≡\} are also useful for box
positioning (see Chapter 26).
\danger There is also a way to repeat a box as many times as necessary to fill up
some given space; this is what printers call ``leaders.''
The general construction is ``{\≡\leaders≡\}$\langle$box or rule$\rangle\langle
$glue$\rangle$'', where $\langle$box or rule$\rangle$ is any box or rule
specified by {\≡\hbox≡\} or {\≡\vbox≡\} or {\≡\box≡\} or {\≡\page≡\} or
{\≡\hrule≡\} or {\≡\vrule≡\}, and where $\langle$glue$\rangle$ is specified
by {\≡\hskip≡\} or {\≡\hfill≡\} in horizontal mode, {\≡\vskip≡\} or {\≡\vfill≡\}
in vertical mode. \TEX\ treats the glue in the normal way, possibly stretching
it or shrinking it; but then instead of leaving the resulting space blank,
\TEX\ places the contents of the box there, as many times as it will fit,
subject to the condition that the reference point of each box will be congruent
to some fixed number, modulo the box's width (in horizontal leaders) or modulo
the box's height plus depth (in vertical leaders). This ``congruence'' means that
leaders in different places will line up with each other. For example,
$$\vbox{\halign{#\hfill\cr
{\≡\def\lead{\leaders\hbox to 10pt{\hfill.\hfill}\hfill}≡\}\cr
{\≡\hbox to size{Alpha\lead Omega}≡\}\cr
{\≡\hbox to size{The Beginning\lead The Ending}≡\}\cr}}$$
will produce the following two lines:
$$\vcenter{
\def\lead{\leaders\hbox to 10pt{\hfill.\hfill}\hfill}
\hbox to size{Alpha\lead Omega}
\hbox to size{The Beginning\lead The Ending}
}$$
(Here ``{\≡\hbox to 10pt{\hfill.\hfill}≡\}'' specifies a box 10 points wide,
with a period in its center; the control sequence {\≡\lead≡\} then
causes this box to be replicated when filling another box.)\xskip
When a rule is used
as a leader, it completely fills the glue space; for example, if we had made
the definition ``{\≡\def\lead{\leaders\hrule\hfill}≡\}'', the two lines
would have come out looking this way instead:
$$\vcenter{
\def\lead{\leaders\hrule\hfill}
\hbox to size{Alpha\lead Omega}
\hbox to size{The Beginning\lead The Ending}
}$$
\vskip-6pt
\danger Leaders can be used in an interesting way to construct variable-width
braces in the horizontal direction. \TEX's math extension font cmathx (used with
{\tt basic} format) contains four characters that allow you to typeset such
braces in the following way. First make the definitions
$$\vbox{\halign{#\hfill\cr
{\≡\def\bracex{\leaders\hrule height 1.5pt \hfill}≡\}\cr
{\≡\def\dnbrace{$\char≡'772$\bracex$\char≡'775≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \char≡'774$\bracex$\char≡'773$}≡\}\cr
{\≡\def\upbrace{$\char≡'774$\bracex$\char≡'773≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \char≡'772$\bracex$\char≡'775$}≡\}\cr}}$$
Then
$$\vbox{\halign{#\hfill\cr
{\≡\hbox to 100pt{\dnbrace}≡\}\cr
{\≡\hbox to 200pt{\upbrace}≡\}\cr}}$$
will produce
$$\def\bracex{\leaders\hrule height 1.5pt \hfill}
\def\dnbrace{$\char'772$\bracex$\char'775
\char'774$\bracex$\char'773$}
\def\upbrace{$\char'774$\bracex$\char'773
\char'772$\bracex$\char'775$}
\vcenter{\hbox to 100pt{\dnbrace}
\hbox to 200pt{\upbrace}}$$
This is occasionally useful in connection with math formulas.
\danger \exno 21.4: How do you think the author of this manual made asterisks
fill the rest of the current page? [{\sl Hint:} The asterisk used (in font
cmr10) has a height of 7.5 points.] \enddanger
\leaders\chop to 0pt{\hbox to size{\hfill*\lower 3.75pt\hbox{*}\!
*\lower 3.75pt\hbox{*}*}}\vfill
\specialchapterbegin 22. {Alignment}
A novice \TEX\ user can prepare manuscripts that involve mathematical
formulas but no complicated tables; but a \TEX\ Master can prepare complicated
tables using {\≡\halign≡\} or {\≡\valign≡\}. In this chapter, if you're
ready for it, you can learn to be a \TEX\ Master.\xskip
(And the next chapter---which
talks about the design of {\≡\output≡\} routines---will enable you to
become a Grandmaster.)
\danger For simplicity, let's consider {\≡\halign≡\} first; {\≡\valign≡\} is
similar, and it is used much more rarely. If you type
$$\hbox{{\≡\halign to ≡\}$\langle$dimen$\rangle${\≡{≡\}$\langle$alignment
preamble$\rangle${\≡\cr≡\}$\langle$alignment entries$\rangle${\≡}≡\}}$$
in vertical mode or restricted vertical mode, you append a list of aligned
boxes that are each $\langle$dimen$\rangle$ units wide to the current
vertical list; these boxes are formed from the $\langle$alignment entries$\rangle$
by using the specifications in the $\langle$alignment preamble$\rangle$. We've
already seen examples of alignment in Chapter 18, where {\≡\halign≡\} was
used to construct matrices. In general, the preamble tells how to format individual
vertical columns whose entries are going to be assembled into horizontal rows of the
specified width. Before we get into any details of the alignment, let's
observe straightaway that ``{\≡\halign to ≡\}$\langle$dimen$\rangle$''
can be changed to ``{\≡\halign to size≡\}'' if the $\langle$dimen$\rangle$
is to be the current
{\≡\hsize≡\}; it can be shortened to simply ``{\≡\halign≡\}'' if the minimum
size (without shrinking) is desired, or replaced by ``{\≡\halign expand
≡\}$\langle$dimen$\rangle$'' if the boxes should be stretched to a given amount
in addition to this minimum size. In other words, {\≡\halign≡\} has the same
four options as {\≡\hbox≡\}.
\danger The $\langle$alignment preamble$\rangle$ consists of one or more
$\langle$format$\rangle$ specifications separated by {\≡⊗≡\}'s. Each $\langle
$format$\rangle$ specification is a sequence of tokens that is properly nested
with respect to {\≡{...}≡\} groups and contains exactly one ``{\≡#≡\}''.
For example, the $\langle$alignment preamble$\rangle$ suggested for three-column
matrices in Chapter 18 was
$$\hbox{\≡$\ctr{#}$\quad⊗$\ctr{#}$\quad⊗$\ctr{#}$≡\}\quad.$$
A $\langle$format$\rangle$ is essentially a simple {\≡\def≡\} with one parameter;
the idea is to replace the {\≡#≡\} by whatever alignment entry is typed in
that column position. For example, if the $\langle$alignment entries$\rangle$
following this preamble are
$$\hbox{\≡x≡↓1⊗x≡↓2⊗x≡↓3\cr y≡↓1⊗y≡↓2⊗y≡↓3\cr≡\}$$
then there will be two rows of the matrix obtained by substituting these entries
in the preamble, namely
$$\vcenter{\halign{#\cr
{\≡$\ctr{x≡↓1}$\quad≡ ≡ ≡ ≡ ≡ $\ctr{x≡↓2}$\quad≡ ≡ ≡ ≡ ≡ $\ctr{x≡↓3}$≡\}\cr
{\≡$\ctr{y≡↓1}$\quad≡ ≡ ≡ ≡ ≡ $\ctr{y≡↓2}$\quad≡ ≡ ≡ ≡ ≡ $\ctr{y≡↓3}$≡\}\cr}}$$
The $\langle$alignment entries$\rangle$ consist of zero or more $\langle$row$
\rangle$s; and a $\langle$row$\rangle$ is one or more entries separated by
{\≡⊗≡\}'s and followed by {\≡\cr≡\}. In general if the preamble contains $n$
$\langle$format$\rangle$s
$$\tabskip 0pt plus 10000000000pt
\halign to size{\ctr{$# $}\tabskip 0pt⊗#⊗\ctr{$# $}⊗#⊗\ctr{$#
$}⊗#⊗\ctr{$# $}⊗#\hfill\tabskip 0pt plus 10000000000pt\cr
\langle u↓1\rangle\hbox{\tt\char'43}\langle v↓1\rangle⊗{\≡⊗≡\}⊗
\langle u↓2\rangle\hbox{\tt\char'43}\langle v↓2\rangle⊗{\≡⊗≡\}⊗\;\;\cdots\;\;
⊗{\≡⊗≡\}⊗\langle u↓n\rangle\hbox{\tt\char'43}\langle v↓n\rangle\cr
\noalign{\vskip 11pt plus 3pt minus 8pt
\hbox{and if there are $m$ rows each containing $n$ entries}
\vskip 11pt plus 3pt minus 8pt}
\langle x↓{11}\rangle⊗{\≡⊗≡\}⊗\langle x↓{12}\rangle⊗{\≡⊗≡\}⊗
\cdots⊗{\≡⊗≡\}⊗\langle x↓{1n}\rangle⊗{\≡\cr≡\}\cr
\noalign{\penalty 1000}
\langle x↓{21}\rangle⊗{\≡⊗≡\}⊗\langle x↓{22}\rangle⊗{\≡⊗≡\}⊗
\cdots⊗{\≡⊗≡\}⊗\langle x↓{2n}\rangle⊗{\≡\cr≡\}\cr
\noalign{\penalty 1000}
\vdots⊗⊗\vdots⊗⊗⊗⊗\vdots\cr
\noalign{\penalty 1000}
\langle x↓{m1}\rangle⊗{\≡⊗≡\}⊗\langle x↓{m2}\rangle⊗{\≡⊗≡\}⊗
\cdots⊗{\≡⊗≡\}⊗\langle x↓{mn}\rangle⊗{\≡\cr≡\}\cr
\noalign{\vskip 11pt plus 3pt minus 8pt
\hbox{we will obtain $mn$ fleshed-out entries}
\vskip 11pt plus 3pt minus 8pt}
\langle u↓1\rangle\langle x↓{11}\rangle\langle v↓1\rangle⊗⊗
\langle u↓2\rangle\langle x↓{12}\rangle\langle v↓2\rangle⊗⊗\cdots⊗⊗
\langle u↓n\rangle\langle x↓{1n}\rangle\langle v↓n\rangle\cr
\noalign{\penalty 1000}
\langle u↓1\rangle\langle x↓{21}\rangle\langle v↓1\rangle⊗⊗
\langle u↓2\rangle\langle x↓{22}\rangle\langle v↓2\rangle⊗⊗\cdots⊗⊗
\langle u↓n\rangle\langle x↓{2n}\rangle\langle v↓n\rangle\cr
\noalign{\penalty 1000}
\vdots⊗⊗\vdots⊗⊗⊗⊗\vdots\cr
\noalign{\penalty 1000}
\langle u↓1\rangle\langle x↓{m1}\rangle\langle v↓1\rangle⊗⊗
\langle u↓2\rangle\langle x↓{m2}\rangle\langle v↓2\rangle⊗⊗\cdots⊗⊗
\langle u↓n\rangle\langle x↓{mn}\rangle\langle v↓n\rangle\cr}$$
by repeatedly copying the preamble format information.
\danger Now here's what \TEX\ does with the $mn$ fleshed-out entries: The
natural width of each entry {\≡\hbox{≡\}$\langle u↓j\rangle\langle x↓{ij}
\rangle\langle v↓j\rangle${\≡}≡\} is determined; and the {\sl maximum}
natural width is computed in each column. Suppose that $w↓j$ is the maximum natural
width in the $j$th column; then each fleshed-out entry in that column
is replaced by the
box ``{\≡\hbox to ≡\}$w↓j${\≡{≡\}$\langle u↓j\rangle\langle x↓{ij}
\rangle\langle v↓j\rangle${\≡}≡\}''. Thus, all entries in a particular column
now have the same width. Finally these boxes are welded together to make the
$m$ rows, by inserting $n+1$ elements of glue in each row (before the first
box, between boxes, and after the last box). The glue to use in this welding
process has previously been specified by ``{\≡\tabskip≡\}$\langle$glue$\rangle$''.
The $m$ row boxes are finally appended to the current vertical list.
\danger If you don't understand what was said so far, look back at the matrix
example and reread the above until you understand. Because there are also some
refinements that we shall now discuss.\xskip (a) After any {\≡\cr≡\} you can
type ``{\≡\noalign{≡\}$\langle$vlist$\rangle${\≡}≡\}'', and this $\langle$vlist$
\rangle$ will simply appear in its place among the aligned row boxes. The
$\langle$vlist$\rangle$
in this case usually contains vertical glue, penalty specifications,
or horizontal rules; but it might contain anything that is allowed in restricted
vertical mode, even another {\≡\halign≡\}.\xskip(b) If some row has fewer than
$n$ entries, i.e., if the {\≡\cr≡\} of some row occurs before there have been
$n-1$ {\≡⊗≡\}'s, all remaining columns of the row are set to null boxes
regardless of their format.\xskip
(This is not necessarily the same as ``{\≡\hbox{≡\}$
\langle u↓j\rangle\langle v↓j\rangle${\≡}≡\}''; the preamble formats are
simply ignored.)\xskip (c) If you specify {\≡\tabskip≡\}$\langle$glue$\rangle$
in the preamble, the $n+1$ globs of glue that weld together the final row
boxes will be different, so you can get different spacing between columns.
Here's how it works: The glue placed before column 1 is the {\≡\tabskip≡\} glue
in effect when the {\≡\halign≡\} control sequence itself appears; the glue
that replaces a {\≡⊗≡\} or {\≡\cr≡\} is the {\≡\tabskip≡\} glue in effect
when that {\≡⊗≡\} or {\≡\cr≡\} appears in the preamble.
\danger Warning: Any spaces you type in the $\langle$format$\rangle$s of the
preamble will be taken seriously! Don't start a new line after a {\≡⊗≡\} unless
you intend a corresponding space to be there in every column.\xskip (You may, of
course, start a new line after {\≡\cr≡\} without inserting an unwanted space,
or you can type ``{\≡⊗\!≡\}'' and go to a new line.)\xskip The same applies to
spaces in the aligned entries; {\sl always be extra careful with your use of
spaces inside {\≡\halign≡\}.}
\danger Another warning: Don't use a construction like ``{\≡$#$≡\}'' in your
$\langle$format$\rangle$s if the corresponding column entries might be
null. Otherwise \TEX\ will scan ``{\≡$$≡\}'' and think display math is
intended, and this probably will lead to hopeless confusion.\xskip
(The matrix example
above has ``{\≡$\ctr{#}$≡\}'' instead of ``{\≡\ctr{$#$}≡\}'' for precisely this
reason. Another safe possibility would be ``{\≡\ctr{$# $}≡\}''.)
\ddanger You can have {\≡\halign≡\} or {\≡\valign≡\} within {\≡\halign≡\}
or {\≡\valign≡\} (for example, matrices within aligned equations). In order
to allow this, \TEX\ insists that {\≡{≡\} and {\≡}≡\} be balanced in alignment
entries, so that it is possible to distinguish which level of alignment
corresponds to a given {\≡⊗≡\} or {\≡\cr≡\}. Consider, for example, the
extremely simple alignment
$$\vbox{\halign{#\hfill\cr
{\≡\halign{\ctr{#}\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡\}$\langle$entry$\rangle${\≡\cr}≡\}\quad.\cr}}$$
When \TEX\ begins to scan the alignment entry, it scans the string of
tokens ``{\≡\ctr{≡\}\penalty0
$\langle$entry$\rangle${\≡\cr}...≡\}''; and the appearance
of ``{\≡\ctr≡\}'' causes \TEX\ to look for {\≡\ctr≡\}'s argument. This
argument begins with ``{\≡{≡\}'', so the scanning continues until the matching
``{\≡}≡\}''. However, when the {\≡\cr≡\} is encountered after
$\langle$entry$\rangle$, \TEX\ is supposed to insert the matching ``{\≡}≡\}''
from the preamble. If $\langle$entry$\rangle$ itself contains a use of
{\≡\halign≡\}, there will be {\≡\cr≡\}'s in the middle of $\langle$entry$\rangle$;
so \TEX\ doesn't simply look for the first {\≡\cr≡\}. Instead it ignores the
tokens {\≡⊗≡\} and {\≡\cr≡\} until finding one that is not enclosed in
braces, thereby correctly determining the argument to {\≡\ctr≡\}.
\ddanger Defined control sequences in the preamble are not usually expanded
until the alignment entries are being processed.
However, a control sequence following ``{\≡\tabskip≡\}$\langle$glue$\rangle$''
in the preamble might be expanded, since a $\langle$glue$\rangle$ specification
might involve control sequences. For example, ``{\≡\tabskip 0pt \ctr{#}≡\}''
will effectively be expanded by \TEX\ to ``{\≡\tabskip 0pt \hfill # \hfill≡\}''
while the preamble is being scanned, because \TEX\ won't know (when it gets
to ``{\≡\ctr≡\}'') whether or not the expansion of this control sequence will
begin with ``{\≡plus 1pt≡\}'' or some other continuation of the glue
specification.
\danger In the rest of this chapter we shall discuss two worked-out examples.
First suppose that we want to typeset three
pairs of displayed formulas whose = signs are to be aligned, such as
$$\vcenter{\halign{\rt{$#$}⊗\lft{$\null=#$}\qquad
⊗\rt{$#$}⊗\lft{$\null=#$}\qquad
⊗\rt{$#$}⊗\lft{$\null=#$}\cr
V↓i⊗v↓i-q↓iv↓j,⊗X↓i⊗x↓i-q↓ix↓j,⊗U↓i⊗u↓i,\qquad\hbox{for }i≠j;\cr
V↓j⊗v↓j,⊗X↓j⊗x↓j,⊗U↓j⊗u↓j+\sum↓{i≠j}q↓iu↓i.\cr}}\eqno(13)$$
We could do this with three {\≡\eqalign≡\}'s, but let's not, since our
current goal is to learn more about the general {\≡\halign≡\} construction.
One solution is to type
$$\vbox{\halign{#\hfill\cr
{\≡$$\vcenter{\halign{≡\}$\langle$alignment preamble$\rangle${\≡\cr≡\}\cr
{\≡V≡↓i⊗v≡↓i-q≡↓iv≡↓j,⊗X≡↓i⊗x≡↓i-q≡↓ix≡↓j,⊗U≡↓i⊗u≡↓i,\qquad\hbox{for }i≡spose
/=j;\cr≡\}\cr
{\≡V≡↓j⊗v≡↓j,⊗X≡↓j⊗x≡↓j,⊗U≡↓j⊗u≡↓j+\sum≡↓{i≡spose/=j}q≡↓iu≡↓i.\cr}}\eqno(13)$$≡\}\cr
}}$$
with some suitable alignment preamble.\xskip
(It sometimes helps to figure out how you
want to type the alignment entries before you design the preamble; there's a
tradeoff between ease of typing the entries and ease of constructing the
preamble.)\xskip One suitable preamble is
$$\vbox{\halign{#\hfill\cr
{\≡$\rt{#}$⊗\lft{$\null=#$}\qquad≡\}\cr
{\≡⊗$\rt{#}$⊗\lft{$\null=#$}\qquad≡\}\cr
{\≡⊗$\rt{#}$⊗\lft{$\null=#$}≡\}\cr}}\quad.$$
Note the {\≡\null≡\}s here: they ensure proper spacing before the = signs,
because the equations are being broken into two parts. Study this example
carefully and you'll soon see how to make useful alignments.
\danger \exno 22.1: What would happen if ``{\≡\vcenter≡\}'' were replaced by
``{\≡\vbox≡\}'' in the above example?
\danger If we didn't
have to include an equation number like ``(13)'', the {\≡\vcenter≡\} could
have been omitted; but then there would have been a possible page break between
the two equations, and the equations would not have been centered on the line.\xskip
(The only effect of the {\≡$$≡\}'s in ``{\≡$$\halign{...}$$≡\}'' is to insert
{\≡\dispskip≡\} glue above and below the alignment.)\xskip One way to prevent a
page break would be to insert ``{\≡\noalign{\penalty 1000}≡\}'' between
the lines. And one way to center the equations would be to vary the
tabskip glue, as in the definition of {\≡\eqalignno≡\} in Appendix B. But it
is much easier to use {\≡\vcenter≡\}.
\danger The second example is slightly more complex, but once you master it
you will have little or no trouble with other tables. Suppose you want to
specify this:
$$\vbox{\tabskip 0pt
\def\|{\vrule height 9.25pt depth 3pt}
\def\.{\hskip-10pt plus 10000000000pt}
\hrule
\hbox to 150pt{\|\.AT&T Common Stock\.\|}
\hrule
\halign to 150pt{#\tabskip 0pt plus 100pt
⊗\hfill#⊗#⊗\ctr{#}⊗#⊗\hfill#⊗#\tabskip 0pt\cr
\|⊗\.Year\.\hfill⊗\|⊗\.Price\.⊗\|⊗\.Dividend\.\hfill⊗\|\cr
\noalign{\hrule}
\|⊗1971⊗\|⊗41--54⊗\|⊗$\$$2.60⊗\|\cr
\noalign{\hrule}
\|⊗2⊗\|⊗41--54⊗\|⊗2.70⊗\|\cr
\noalign{\hrule}
\|⊗3⊗\|⊗46--55⊗\|⊗2.87⊗\|\cr
\noalign{\hrule}
\|⊗4⊗\|⊗40--53⊗\|⊗3.24⊗\|\cr
\noalign{\hrule}
\|⊗5⊗\|⊗45--52⊗\|⊗3.40⊗\|\cr
\noalign{\hrule}
\|⊗6⊗\|⊗51--59⊗\|⊗.95\spose*⊗\|\cr
\noalign{\hrule}}
\vskip 3pt
\hbox{*(first quarter only)}}$$
including all those horizontal and vertical lines. The table is to be 150
points wide. Here is one way to do it, letting the tabskip glue expand to
give the column widths (so that, for example, the ``Price'' column will turn out
to be exactly one en-dash-width wider than the ``Year'' column):
$$\halign{\hskip 10pt#\cr
{\≡$$\vbox{\tabskip 0pt≡\}\cr
{\≡\def\|{\vrule height 9.25pt depth 3pt}≡\}\cr
{\≡\def\.{\hskip-10pt plus 10000000000pt}≡\}\cr
{\≡\hrule≡\}\cr
{\≡\hbox to 150pt{\|\.AT&T Common Stock\.\|}≡\}\cr
{\≡\hrule≡\}\cr
{\≡\halign to 150pt{#\tabskip 0pt plus 100pt≡\}\cr
{\≡⊗\hfill#⊗#⊗\ctr{#}⊗#⊗\hfill#⊗#\tabskip 0pt\cr≡\}\cr
{\≡\|⊗\.Year\.\hfill⊗\|⊗\.Price\.⊗\|⊗\.Dividend\.\hfill⊗\|\cr≡\}\cr
{\≡\noalign{\hrule}≡\}\cr
{\≡\|⊗1971⊗\|⊗41--54⊗\|⊗$\$$2.60⊗\|\cr\noalign{\hrule}≡\}\cr
{\≡\|⊗2⊗\|⊗41--54⊗\|⊗2.70⊗\|\cr\noalign{\hrule}≡\}\cr
{\≡\|⊗3⊗\|⊗46--55⊗\|⊗2.87⊗\|\cr\noalign{\hrule}≡\}\cr
{\≡\|⊗4⊗\|⊗40--53⊗\|⊗3.24⊗\|\cr\noalign{\hrule}≡\}\cr
{\≡\|⊗5⊗\|⊗45--52⊗\|⊗3.40⊗\|\cr\noalign{\hrule}≡\}\cr
{\≡\|⊗6⊗\|⊗51--59⊗\|⊗.95\spose*⊗\|\cr\noalign{\hrule}}≡\}\cr
{\≡\vskip 3pt≡\}\cr
{\≡\hbox{*(first quarter only)}}$$≡\}\cr}$$
\vskip-6pt
\danger Here is an explanation of this rather long sequence of commands:
The control sequence ``{\≡\|≡\}'' is defined to be a vertical rule that
guarantees appropriate spacing of baselines between individual rows.\xskip
(\TEX\ doesn't use {\≡\baselineskip≡\} and {\≡\lineskip≡\} before or after
horizontal rules.)\xskip
The alignment is defined in such a way that the {\≡\tabskip≡\}
glue is zero at the left and right of the alignment, but it is ``{\tt 0pt plus
100pt}'' between columns; this glue will therefore
expand to make the columns equally
spaced. There are seven (not three) columns, since the vertical rules are
considered to be
columns. The preamble has just ``{\≡#≡\}'' for the columns that are to be
vertical rules; the ``Year'' column and ``Dividend'' column both have format
``{\≡\hfill#≡\}'', causing them to be right-justified, while the ``Price''
column has format ``{\≡\ctr{#}≡\}''. The top row of the table appears
before the {\≡\halign≡\}, since it does not have to be aligned with
the other rows. In the second row of the table, an extra ``{\≡\hfill≡\}''
has been typed after ``Year'' and ``Dividend'', to compensate for the
fact that the columns are being right-justified yet the titles are supposed to
be centered. The special control sequence ``{\≡\.≡\}'' is also placed around
these title words; this is somewhat tricky. It has the effect of telling
\TEX\ to ignore the width of the title words when computing the column widths.
The asterisk in the final row of the table is preceded by ``{\≡\spose≡\}'' in
order to make it zero-width, otherwise the decimal points wouldn't line up
properly.
\danger Another way to get vertical and horizontal rules into tables is to
typeset without them, then back up (using negative glue) and insert them.
\danger The control sequence {\≡\valign≡\} is analogous to {\≡\halign≡\}, but
with rows and columns changing r\A oles. In this case {\≡\cr≡\} marks the
bottom of a column. The boxes in each row will line up as if their reference
points were at the bottom; in other words, their depth is effectively set
to zero by modifying their height.\enddanger
\chapterbegin 23. {Output routines}
We discussed \TEX's page-building technique in Chapter 15. Constructed pages
will be output directly, if the book design you are using
has not specified any special {\≡\output≡\} routine.
But usually a designer will have given special instructions that attach
page numbers, headings, and so on. Even the {\tt basic} format in Appendix B has
a simple {\≡\output≡\} routine, described at the end of Chapter 15.
Complex {\≡\output≡\} specifications use the most arcane features of \TEX,
so it usually takes a designer three or four trials before he or she gets
them right. Thus, you'll want to skip the rest of this chapter when you're
first learning the \TEX\ language. But---like alignments---{\≡\output≡\} routines
soon lose their mystery after you have some experience with them.
\danger When you type ``{\≡\output{≡\}$\langle$output list$\rangle${\≡}≡\}'', the
specified output list is stored away for later use, without expanding any of its
defined control sequences. Then, when \TEX\ decides to output a page, the
saved output list is effectively inserted into the input, wherever \TEX\
happens to be reading the input at the time. The purpose of the output list is
to construct a box from a vertical list, as if one had typed $$\hbox{{\≡\vbox{≡\}$
\langle$output list$\rangle${\≡}≡\}};$$ this box is what gets output. The
output routine might, however, produce a null box, if it saves away the current
page in order to combine it with a later page.
\danger This would be a good time for you to reread Chapter 15 if you don't recall
\TEX's mechanism for breaking pages. Since \TEX\ looks ahead for a good place to
break---it usually is well into page 109, say, before page 108 is output---some
care is needed to synchronize this asynchronous mechanism. For example, if you
want to put the current section title at the top of each page, the section title
might have changed by the time that page is actually shipped off to the output
routine, since \TEX\ might be working on a new section before finding the most
desirable break. An {\≡\output≡\} routine therefore needs some way of remembering
past history. Such coordination is provided by so-called {\sl marks\/}; when
you're in vertical mode, you can type ``{\≡\mark{≡\}$\langle$mark text$\rangle
${\≡}≡\}''. This causes the $\langle$mark text$\rangle$ to be invisibly
attached to your current position in the vertical list that is being broken into
pages. If defined control sequences appear in a $\langle$mark text$\rangle$, they
are expanded at the time the mark appears, so that the {\≡\output≡\} routine will
later be able to make use of values that were current.
\danger The best way to think of this is probably to regard vertical mode as the
mode in which you generate an arbitrarily long vertical list of boxes that
somehow gets divided up into pages. The long vertical list may contain marks, and
whenever you are outputting a page the {\≡\output≡\} routine will be able to
make use of the most recent mark preceding the break at the bottom of the
page ({\≡\botmark≡\}), the most recent mark preceding the break at the
top of the page ({\≡\topmark≡\}), and the first mark on the page
({\≡\firstmark≡\}).
For example, suppose your manuscript includes four instances
of {\≡\mark≡\}, and suppose that the pages get broken in such a way that
{\≡\mark{≡\}$\alpha${\≡}≡\} happens to fall on page 2, {\≡\mark{≡\}$\beta${\≡}≡\}
and {\≡\mark{≡\}$\gamma${\≡}≡\} on page 4, and {\≡\mark{≡\}$\delta${\≡}≡\} on
page 5. Then
$$\vbox{\halign{\hfill#\hfill\qquad⊗\hfill#\hfill\qquad
⊗\hfill#\hfill⊗\hfill#\hfill\cr
On page⊗{\≡\topmark≡\} is⊗{\≡\firstmark≡\} is⊗{\≡\botmark≡\} is\cr
\noalign{\vskip 3pt}
1⊗null⊗null⊗null\cr
2⊗null⊗$α$⊗$α$\cr
3⊗$α$⊗$α$⊗$α$\cr
4⊗$α$⊗$β$⊗$\gamma$\cr
5⊗$\gamma$⊗$\delta$⊗$\delta$\cr
6⊗$\delta$⊗$\delta$⊗$\delta$\cr}}$$
(When there is no mark, all three of these are equal.)\xskip
The mark concept makes it possible to typeset things like dictionaries, where
you want to indicate the current word-interval at the top of each page, if
appropriate marks are inserted just before and after the space between entries.
\danger \TEX\ has four control sequences that you are allowed to use
only in {\≡\output≡\}
routines:\xskip (i) {\≡\page≡\}, which represents the box containing the current
page being output;\xskip (ii) {\≡\topmark≡\}, which represents the top mark for
the current page (the corresponding $\langle$mark text$\rangle$ is inserted into
\TEX's input at this point);\xskip (iii,iv) {\≡\botmark≡\} and {\≡\firstmark≡\},
which are analogous
to {\≡\topmark≡\}. The {\≡\output≡\} routine should use {\≡\page≡\} exactly
once each time a page is to be output, but it may use {\≡\topmark≡\},
{\≡\botmark≡\}, and {\≡\firstmark≡\} as often as desired.
\danger There are several other control sequences of special interest in
connection with output routines, even though they are allowed to appear almost
anywhere in a \TEX\ manuscript:
\yskip\noindent\hang{\≡\setcount≡\}$\langle$digit$\rangle
\langle$optional sign$\rangle\langle
$number$\rangle$\xskip
Sets one of ten ``counters'' to the specified number (possibly
negative). For example, ``{\≡\setcount2 53≡\}'' sets counter number 2 equal to
53.
\yskip\noindent\hang{\≡\count≡\}$\langle$digit$\rangle$\xskip The current value of
the specified ``counter'' is
inserted into the input. If this number is zero, the result is the
single digit ``{\tt0}''; if positive, the result is expressed as a decimal
integer without leading zeros; if negative, the result is expressed as a roman
numeral with lower case letters.\xskip (For example, $-18$ yields ``{\tt xviii}'',
$-19$ yields ``{\tt xix}''.)\xskip As mentioned in Chapter 8, {\≡\count≡\}$\langle
$digit$\rangle$ can also be used when \TEX\ is expecting a $\langle$number$\rangle$;
for example, ``{\≡\setcount4\count2≡\}'' sets counter number 4 equal to the current
contents of counter number 2.
\yskip\noindent\hang{\≡\advcount≡\}$\langle$digit$\rangle$\xskip The specified
``counter'' is increased by 1 if it is zero or positive, decreased by 1 if it
is negative.\xskip
(Thus, its magnitude increases by 1, but it retains the same sign.)
\yskip\noindent\hang{\≡\ifeven≡\}$\langle$digit$\rangle${\≡{≡\}$\langle
$true text$\rangle
${\≡}\else{≡\}$\langle$false text$\rangle${\≡}≡\}\xskip If the specified ``counter''
is even, the $\langle$true text$\rangle$ is input and the $\langle$false text$
\rangle$ is ignored; if odd, the $\langle$true text$\rangle$ is ignored and the
$\langle$false text$\rangle$ is input.
\yskip\noindent\hang{\≡\if≡\} $\langle$char$↓1\rangle\langle$char$
↓2\rangle${\≡{≡\}$\langle$true text$\rangle
${\≡}\else{≡\}$\langle$false text$\rangle${\≡}≡\}\xskip If the input $\langle$char$
↓1\rangle$ is equal to the input $\langle$char$↓2\rangle$,
the $\langle$true text$\rangle$ is input and the $\langle$false text$
\rangle$ is ignored; if not, the $\langle$true text$\rangle$ is ignored and the
$\langle$false text$\rangle$ is input.
\yskip\noindent Typical uses of {\≡\if≡\} have $\langle$char$↓1\rangle$
constant, while $\langle$char$↓2\rangle$ is specified by a control sequence
that has been defined elsewhere. For example, you might type $$\hbox{\≡\def
\firsttime{T}≡\}$$ at the beginning of a chapter; then
$$\hbox{{\≡\if T\firsttime{\gdef\firsttime{F}}\else{≡\}$\alpha${\≡}≡\}}$$
will do $α$ every time except the first, in each chapter.\xskip
(Note that {\≡\gdef≡\}
must be used here instead of {\≡\def≡\}, otherwise the new definition of
{\≡\firsttime≡\} would be rescinded immediately!)
\danger Now let's look at some examples. First, suppose you want your output
pages to be numbered consecutively, with a number in font {\tt c}
centered at the bottom of each page. Suppose further that you want a running
title in font {\tt b} to be centered at the top of each page, except on the
first page of each chapter. Each page (not counting margins) is to be
4$1\over2$ inches wide and 7$1\over2$ inches tall; but the pages output by
\TEX's page builder will have a height of 6$1\over2$ inches and a maximum
depth of $1\over16$ inch, so that you can put the running title in a
half-inch strip at the top of each page, and you can put the current page number in
a $7\over16$- to $1\over2$-inch strip at the bottom. Let's assume that
font {\tt z} is a big bold font suitable for chapter titles. Then the {\≡\output≡\}
might be designed as follows:
$$\tabskip 0pt plus 100pt \halign{#\cr
{\≡\hsize4.5in\vsize6.5in\maxdepth.0625in ≡hfill% inner page dimensions≡\}\cr
\noalign{\penalty1000}
{\≡\gdef\tpage{F} ≡hfill% \tpage will be T for title pages≡\}\cr
{\≡\def\chapterbegin#1. #2{ ≡hfill% control sequence for new chapters≡\}\cr
{\≡≡ ≡ \vfill\eject ≡hfill% finish previous chapter and begin a new page≡\}\cr
{\≡≡ ≡ \gdef\tpage{T} ≡hfill% first page of chapter is a title page≡\}\cr
{\≡≡ ≡ \vskip .5in ≡hfill% extra space above chapter title≡\}\cr
{\≡≡ ≡ \ctrline{\:z Chapter #1.} ≡hfill% first line of title≡\}\cr
{\≡≡ ≡ \vskip .25in ≡hfill% extra space between title lines≡\}\cr
{\≡≡ ≡ \ctrline{\:z #2} ≡hfill% second line of title≡\}\cr
{\≡≡ ≡ \vskip .5in ≡hfill% space between title and first paragraph≡\}\cr
{\≡≡ ≡ \mark{#2} ≡hfill% insert a mark containing the running title≡\}\cr
{\≡≡ ≡ \noindent ≡hfill% first paragraph will not be indented≡\}\cr
{\≡≡ ≡ \tenpoint\!} ≡hfill% and it will use 10-point type fonts≡\}\cr
\noalign{\yyskip}
{\≡\output{\vbox to 7.5in{ ≡hfill% begin output of 7.5-inch page≡\}\cr
{\≡≡ ≡ ≡ ≡ \baselineskip0pt\lineskip0pt ≡hfill% turn off interline glue≡\}\cr
{\≡≡ ≡ ≡ ≡ \if T\tpage{ ≡hfill% test if title page≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ \gdef\tpage{F}\vskip.5in} ≡hfill% no running head on title page≡\}\cr
{\≡≡ ≡ ≡ ≡ \else{\vbox to.15in{\vfill ≡hfill% fill space above running head≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \hbox to 4.5in{\hfill\:b\topmark\hfill}} ≡hfill
% running head≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ \vskip .35in} ≡hfill% space between running head and inner page≡\}\cr
\noalign{\penalty-50}
{\≡≡ ≡ ≡ ≡ \page ≡hfill% place the compiled inner page just below top strip≡\}\cr
{\≡≡ ≡ ≡ ≡ \vfill ≡hfill% space between inner page and page number≡\}\cr
{\≡≡ ≡ ≡ ≡ \hbox to 4.5in{\hfill\:c\count0\hfill}} ≡hfill% page number≡\}\cr
\noalign{\penalty1000}
{\≡≡ ≡ \advcount0} ≡hfill% increase page number, end the \output routine≡\}\cr}$$
With this setup one types, for example,
``{\≡\chapterbegin 13. {UNLUCKY NUMBERS}≡\}''
at the beginning of chapter number 13. Appendix E shows how the more elaborate page
layout of {\sl The Art of Computer Programming} can be handled.
\danger\exno 23.1: Why is it better for this {\≡\output≡\} routine
to say ``{\≡\hbox to 4.5in≡\}'' than to say ``{\≡\hbox to size≡\}''?
\danger\exno 23.2: How would you change the above {\≡\output≡\} routine
so that pages will come out with the top line of non-title pages saying
``$\langle$page number$\rangle$\vrule height .4pt depth 0pt width 16pt
$\langle$running title$\rangle$'' on even-numbered
pages and ``$\langle$running title$\rangle$\vrule height .4pt depth 0pt width 16pt
$\langle$page number$\rangle$'' on odd-numbered pages?\xskip
(Leave the page number at the bottom of title pages.)
\danger One more example should suffice to give the flavor of {\≡\output≡\}
routines. Suppose you wish to typeset three-column format: three individual
columns $6↑{\prime\prime}$ tall by $1{1\over2}↑{\prime\prime}$ wide are to
appear on a $7↑{\prime\prime}\times5↑{\prime\prime}$ page, with vertical
rules between the columns. The page number is to be placed in the upper left
corner of even-numbered pages and in the upper right corner of odd-numbered
pages. For this application you should use {\≡\hsize 1.5in≡\} and {\≡\vsize
6in≡\}; and, say, {\≡\maxdepth.2in≡\}.\xskip (Recall that {\≡\maxdepth≡\} is the
maximum amount by which the depth of the bottom line on a page is allowed to
overhang the {\≡\vsize≡\}.)\xskip The {\≡\output≡\} routine has to save the first
two ``pages'' it receives, then it must spew out three at once. There are
at least two ways to do the job:
$$\halign{\hskip19pt\sl#\hfill⊗#\hfill\cr
Solution 1. ⊗{\≡\output{\outa}≡\}\cr
\noalign{\penalty1000}
⊗{\≡\def\outa{\output{\outb}\save1\page}≡\}\cr
\noalign{\penalty1000}
⊗{\≡\def\outb{\output{\outc}\save2\page}≡\}\cr
⊗{\≡\def\outc{\output{\outa}≡\}\cr
⊗{\≡≡ ≡ \vbox to 7in{\baselineskip0pt\lineskip0pt≡\}\cr
⊗{\≡≡ ≡ ≡ ≡ \vbox to 10pt{\vfill≡\}\cr
⊗{\≡≡ ≡ ≡ ≡ ≡ ≡ \hbox to 5in{\:b≡\}\cr
\noalign{\penalty1000}
⊗{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \ifeven0{\count0\hfill}\else{\hfill\count0}}}≡\}\cr
⊗{\≡≡ ≡ ≡ ≡ \vfill≡\}\cr
⊗{\≡≡ ≡ ≡ ≡ \hbox to 5in{\box1\hfill\vrule\hfill\box2≡\}\cr
⊗{\≡≡ ≡ ≡ ≡ ≡ ≡ \hfill\vrule\hfill\page}}≡\}\cr
⊗{\≡≡ ≡ \advcount0}≡\}\cr
\noalign{\penalty-50}
Solution 2. ⊗{\≡\def\firstcol{T}≡\}\cr
⊗{\≡\output{\if T\firstcol{\gdef\firstcol{F}≡\}\cr
⊗{\≡≡ ≡ ≡ ≡ \gdef\secondcol{T}\save1\page}≡\}\cr
⊗{\≡≡ ≡ \else{\if T\secondcol{\gdef\secondcol{F}≡\}\cr
⊗{\≡≡ ≡ ≡ ≡ ≡ ≡ \save2\page}≡\}\cr
⊗{\≡≡ ≡ ≡ ≡ \else{\gdef\firstcol{T}≡\}\cr
\noalign{\penalty1000}
⊗{\≡≡ ≡ ≡ ≡ ≡ ≡ \vbox to 7in{...≡\}(as before){\≡...}\advcount0}}}≡\}\cr}$$
Solution 1 is more elegant, but the switching mechanism of Solution 2 can be
used in more complicated situations.\enddanger
\chapterbegin 24. {Summary of vertical mode}
Now here is a complete specification of everything you are allowed to type
in vertical mode. This chapter and the following two are intended to be a
concise and precise summary of what we have been discussing rather informally.
Perhaps it will be a useful reference when you're stuck and wondering
what \TEX\ allows you to do.
\def\<{$\langle$}\def\>{$\rangle$}
\def\⊃{\penalty1000\noindent}
\ninepoint
\yskip
Chapter 13 explains the general idea of vertical mode and restricted vertical
mode. In both cases
\TEX\ is scanning a ``\<vlist\>'' and building a vertical
list containing boxes and glue; this list might also contain other things
like penalty and mark specifications. The
vertical list is empty when \TEX\ first enters vertical mode or restricted
vertical mode, and it remains empty unless something is appended to it as
explained in the rules below.
For brevity the rules are stated for vertical mode; the same rules apply to
restricted vertical mode unless the contrary is specifically stated.
When \TEX\ is in vertical mode, its next action depends on what it sees next,
according to the following possibilities:
\def\b{\yskip\textindent{$\bullet$}}
\def\bb{\yyskip\textindent{$\bullet$}}
\b \<space\>\qquad Do nothing.
\⊃ This notation means: If \TEX\ is in vertical mode
and you type a blank
space, nothing happens and \TEX\ stays in vertical mode.\xskip(The end of a line
in an input file counts as a blank space, and so do certain other characters,
as explained in Chapter 7.)
\b {\≡\par≡\}\qquad Do nothing.
\⊃ End of paragraph is ignored in vertical mode. This applies also to
the ``end of paragraph'' signal that \TEX\ digests when you have blank lines
in the input or at the end of a file page.
\b \<unknown control sequence\>\qquad
``{\tt ! Undefined control sequence.}''
\⊃ For example, if you type ``{\≡\hbx≡\}'' instead of ``{\≡\hbox≡\}'',
and if {\≡\hbx≡\} hasn't been defined, you get an error message showing that
{\≡\hbx≡\} has just been scanned. To recover you can type ``{\tt i}'' (for
insertion); then (when prompted by ``{\tt*}'') type ``{\≡\hbox≡\}'' and
\<carriage-return\>, and \TEX\ will resume as if the misspelling hadn't occurred.
\b \<defined control sequence\>\qquad Macro call.
\⊃ A control sequence that has been defined with {\≡\def≡\} or {\≡\gdef≡\},
for example a control sequence defined
in a book format such as Appendix B or Appendix E,
followed by its ``arguments'' (if any), will be replaced in the input as
explained in Chapter 20.
\b {\≡{≡\}\qquad Begin a new group.
\⊃ A new level of nomenclature begins, as explained in Chapter 5; a
matching {\≡}≡\} should appear later. The matching {\≡}≡\} usually occurs
in vertical mode, but it might occur in horizontal mode (in the midst of
some paragraph). The beginning of a new group does not affect the current
vertical list.
\b {\≡}≡\}\qquad End a group or an operation.
\⊃ The matching {\≡{≡\} is identified, and all intervening {\≡\def≡\}s,
{\≡\chcode≡\}s, {\≡\chpar≡\}s, current font definitions,
and glue parameter definitions are forgotten. If the
matching {\≡{≡\} is the beginning of a group, \TEX\ remains in vertical mode
and the current vertical list is not affected. Otherwise \TEX\
finishes whatever the {\≡{≡\} marked the beginning of, or you get an
error message. The error messages are ``{\≡Too many }≡'s≡\}'', meaning that
there was no matching {\≡{≡\}; or ``{\≡Extra }≡\}'', meaning that
an unmatched right brace appears in the $\langle v↓n\rangle$ list of
some alignment preamble;
or ``{\≡Missing \cr inserted≡\}'', meaning that
the matching {\≡{≡\} was in ``{\≡\valign≡\}\<spec\>{\≡{≡\}''. In the former
cases the {\≡}≡\} is ignored; in the latter case a {\≡\cr≡\} is inserted.
\b {\≡\hrule≡\}\<rule spec\>\qquad Append a horizontal rule.
\⊃ The specified horizontal line is appended to the current vertical
list.\xskip (See Chapter 21 for further details.)\xskip
\TEX\ remains in vertical mode.
\b \<box\>\qquad Append a box.
\⊃ Here \<box\>\ means one of the following:
$$\vbox{\halign{#\hfill\qquad⊗#\hfill\cr
{\≡\hbox≡\}\<spec\>{\≡{≡\}\<hlist\>{\≡}≡\}⊗box formed in restricted horizontal
mode\cr
{\≡\hbox par ≡\}\<dimen\>{\≡{≡\}\<hlist\>{\≡}≡\}⊗boxed paragraph in restricted
horizontal mode\cr
{\≡\vbox≡\}\<spec\>{\≡{≡\}\<vlist\>{\≡}≡\}⊗box formed in restricted vertical
mode\cr
{\≡\box≡\}\<digit\>⊗saved box (e.g., {\≡\box1≡\} was saved by {\≡\save1≡\})\cr
{\≡\page≡\}⊗current page (allowed only in output routines)\cr}}$$
And \<spec\>\ is one of the following:
$$\vbox{\halign{#\hfill\qquad⊗#\hfill\cr
{\tt to }\<dimen\>⊗desired width or height is specified\cr
{\tt to size}⊗width {\≡\hsize≡\} or height {\≡\vsize≡\}\cr
\<nothing\>⊗use natural width or height\cr
{\tt expand }\<dimen\>⊗augment natural width or height\cr}}$$
(Chapters 21 and 23 give further details.)\xskip The specified box is appended to
the current vertical list, with appropriate interline glue depending on
{\≡\baselineskip≡\} and {\≡\lineskip≡\} inserted
just before it, as described in Chapter 15.\xskip
(After using {\≡\box≡\} or {\≡\page≡\}, that {\≡\box≡\} or {\≡\page≡\}
becomes null, so it can't be used twice.)\xskip
Then \TEX\ resumes scanning in vertical mode.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\moveleft≡\}\cr{\≡\moveright≡\}\cr}}\right>
$\<dimen\>\<box\>\qquad
Append a shifted box.
\⊃ The specified box is appended to the current vertical list
as described above, but its contents are shifted left or right by the
specified amount.\xskip (The right edge of the shifted box is used in figuring
the maximum width of the box ultimately constructed from the current
vertical list; but if the left edge of the appended box extends to the left of
the current reference point, it will stick out of the constructed box.)
\b {\≡\save≡\}\<digit\>\<box\>\qquad Save a box.
\⊃ The specified box is stored away for possible later use by
``{\≡\box≡\}\<digit\>''. Then \TEX\ resumes scanning in vertical mode, having
made no change to its current vertical list.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\vfill≡\}\cr{\≡\vskip≡\}\<glue\>\cr}}\right>$\qquad Append glue.
\⊃ The specified glue is appended to the current vertical list.\xskip
(See Chapter 12 for details about glue.)\xskip\TEX\ remains in vertical mode.
\bb {\≡\leaders≡\}$\left<\vcenter{\halign{\hfill#\hfill\cr
\<box\>\cr\<rule\>\cr}}\right>\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\vfill≡\}\cr
{\≡\vskip≡\}\<glue\>\cr}}\right>$\qquad Append leaders.
\⊃ The specified leaders are appended to the current vertical list;
this will have an effect like the specified glue except that the box or rule will be
replicated in the resulting space (see Chapter 21). \TEX\ remains in vertical mode.
\b {\≡\noindent≡\}\qquad Begin nonindented paragraph.
\⊃ (Not allowed in restricted vertical mode.)\xskip The glue currently
specified by {\≡\parskip≡\} is appended
to the current vertical list. Then \TEX\ switches from
page building to paragraph building by going into horizontal mode:
What you type from now on until the next
{\≡\par≡\} will be assembled into a paragraph and appended to the current
vertical list.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
\<char\>\cr\<accent\>\cr{\≡$≡\}\cr}}\right>$\qquad Begin indented paragraph.
\⊃ (Not allowed in restricted vertical mode.)\xskip
Here \<char\>\ stands for either \<letter\>\ or \<otherchar\>\ or \<nonmathletter\>\
or {\≡\char≡\}\<number\>, all of which are defined in Chapter 25.
When any of these things
occurs in vertical mode, \TEX\ thinks it is time to start a paragraph. The
operations described above for {\≡\noindent≡\} are performed; then an empty box
whose width is the current value of {\≡\parindent≡\} is placed at the beginning
of a horizontal list, which will become the next paragraph. Then processing
continues as if the \<char\>\ or \<accent\>\ or {\≡$≡\} had appeared in
horizontal mode. See Chapter 25 for a description of what happens next.\xskip
(Note that
a paragraph won't start with a box; if you really want to start a paragraph
with a box, enclose it in {\≡$≡\}'s.)
\b {\≡\penalty≡\}\<number\>\qquad Append a page break penalty.
\⊃ (Has no effect in restricted vertical mode.)\xskip
If the specified number is 1000 or more, page breaking is inhibited
here; otherwise this number is added to the badness when deciding whether to
break a page at this place. A negative penalty indicates a desirable place
to break.\xskip (See Chapter 15.)\xskip\TEX\ remains in vertical mode.
\b {\≡\eject≡\}\qquad Force a page break.
\⊃ (Has no effect in restricted vertical mode.)\xskip
A new page will start at this place in the current vertical list, no matter how
``bad'' it may be to break a page here. Two consecutive {\≡\eject≡\}s count as
a single one. \TEX\ remains in vertical mode.
\b {\≡\mark{≡\}\<mark text\>{\≡}≡\}\qquad Append a mark.
\⊃ (Not allowed in restricted vertical mode.)\xskip The mark text is attached
invisibly to the current vertical list, with its defined control sequences
expanded. \TEX\ remains in vertical mode.
\b \<stored mark\>\qquad Insert the text of a stored mark.
\⊃ (Here \<stored mark\>\ stands for one of the control sequences
{\≡\topmark≡\}, {\≡\botmark≡\}, or {\≡\firstmark≡\}. These are allowed
only in {\≡\output≡\} routines.)\xskip \TEX\ inserts the specified
mark text into its input; see Chapter 23.
\b {\≡\x≡\}\qquad Extension to \TEX.
\⊃ The control sequence {\≡\x≡\} allows special actions that might
exist in some versions of \TEX.\xskip (Such extensions are obtained by loading
a separately compiled module with the \TEX\ system; individual users might
have their own special extension modules.)
\b {\≡\halign≡\}\<spec\>{\≡{≡\}\<alignment preamble\>{\≡\cr≡\}\<alignment
entries\>{\≡}≡\}\hskip 20pt minus 20pt Append alignment.
\⊃ A vertical list of aligned rows is constructed as
explained in Chapter 22, and this list is appended to the
current list. Interline glue will be calculated as if the aligned boxes
had been appended one by one in the ordinary way.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡⊗≡\}\cr{\≡\cr≡\}\cr}}\right>$\qquad
Spurious alignment delimiter.
\⊃ The symbols {\≡⊗≡\} and {\≡\cr≡\} are detected deep inside \TEX's
scanning mechanism when they occur at the proper nesting level of braces, because
they cause \TEX\ to start scanning a ``\<$v↓j$\>'' as explained in Chapter 22.
Therefore if these symbols appear in vertical mode, they are ignored, and you
get the error message ``{\≡There's no \halign or \valign going on.≡\}''
\b {\≡\ENDV≡\}\qquad End of alignment entry.
\⊃ An {\≡\ENDV≡\} instruction is inserted automatically by \TEX\ at the end
of each ``\<$v↓j$\>'' list of an alignment format.\xskip
(You can't actually give this
control sequence yourself; it only occurs implicitly.)\xskip
If the alignment entry involves an unmatched {\≡{≡\},
you get the message ``{\≡Missing } inserted.≡\}''
Otherwise \TEX\ finishes processing
this entry, by {\≡\vbox≡\}ing the current vertical list,
and appends the resulting box to the current column of the current {\≡\valign≡\}.\!
\xskip
(Interline glue is not used, but {\≡\tabskip≡\} glue will be inserted.)\xskip
If the present {\≡\ENDV≡\} corresponds to an alignment entry that was followed
by {\≡\cr≡\}, \TEX\ looks at the next part of the input as follows: Blank
spaces are ignored; ``{\≡\noalign{≡\}\<hlist\>{\≡}≡\}'' causes the \<hlist\>\ to
be processed in restricted horizontal mode, and the resulting horizontal list
is appended to the horizontal list of the current {\≡\valign≡\}ment; ``{\≡}≡\}''
terminates the {\≡\valign≡\}; and anything else is assumed to begin the
next column of the alignment, so \<$u↓1$\>\ is inserted into the input.
On the other hand, if this {\≡\ENDV≡\} corresponds to an entry that was followed
by {\≡⊗≡\}, \TEX\ inserts \<$u↓{j+1}$\>\ into the input. In either case
\TEX\ remains in restricted vertical
mode to process the new alignment entry, beginning with an empty vertical list.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\topinsert≡\}\cr{\≡\botinsert≡\}\cr}}\right>
${\≡{≡\}\<vlist\>{\≡}≡\}\qquad Floating insertion of a vertical list.
\⊃ (Not allowed in restricted vertical mode.)\xskip
\TEX\ reads the specified \<vlist\>\ in restricted vertical mode and constructs the
corresponding vertical list. This list will be inserted at the top or bottom
of the next page on which it will fit, followed by {\≡\topskip≡\} glue or
preceded by {\≡\botskip≡\} glue, respectively (see Chapter 15). If possible,
two or more inserts will appear on the same page in first-in-first-out
order. Note that stretchable or shrinkable glue in the vertical list is not set
until the page is finally made up. After the specified list has been constructed
and stored in a safe place, \TEX\ resumes vertical mode where it left off.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr {\≡\def≡\}\cr {\≡\gdef≡\}\cr}}\right>$
\<controlseq\>\<parameter text\>{\≡{≡\}\<result text\>{\≡}≡\}
\hskip 20pt minus 20pt Define a control sequence.
\⊃ The specified
control sequence is defined as described in Chapter 20. \TEX\ remains
in vertical mode, and the current vertical list is not affected. You are not
allowed to redefine certain control sequences like {\≡\:≡\} and {\≡\baselineskip≡\},
because \TEX\ relies on these to control its operations at critical points.
Definitions with {\≡\def≡\} disappear at the end of the current group;
definitions with {\≡\gdef≡\} do not. It is best not to apply both {\≡\def≡\} and
{\≡\gdef≡\} to the same control sequence in different parts of a manuscript.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr {\≡\:≡\}\cr{\≡\mathex≡\}\cr}}\right>
$\<font\>\qquad Define the current font.
\⊃ The specified font code is selected; ``{\≡\:≡\}'' selects the current
font to be used in horizontal mode, as explained in Chapter 4, while
``{\≡\mathex≡\}'' selects the current {\tt ex} font to be used in mathematics mode,
as explained in Chapter 18. If this code is making its first
appearance in the manuscript
it must be followed by the font file name (see Chapter 4 and
Appendix S) followed by a space. Current font code selections
are ``local'' and will be
forgotten at the end of the current group. \TEX\ remains in vertical mode, and
the current vertical list is not affected.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\mathrm≡\}\cr{\≡\mathit≡\}\cr{\≡\mathsy≡\}\cr
}}\right>$\<font\>\<font\>\<font\>\qquad Define current math fonts.
\⊃ The specified font codes are selected, providing up to three sizes of
characters to be used in math formulas as explained in Chapter 18. If any font
code is making its first appearance in the manuscript, it must be followed by
the font file name (see Chapter 18 and Appendix S) followed by a space. Current
font code selections
are ``local'' and will be forgotten at the end of the current group.
\TEX\ remains in vertical mode, and the current vertical list is not affected.
\b \<dimenparam\>\<dimen\>\qquad Set a dimension parameter.
\⊃ Here \<dimenparam\>\ stands for one of the control sequences
{\≡\hsize≡\}, {\≡\vsize≡\}, {\≡\maxdepth≡\}, {\≡\parindent≡\},
{\≡\topbaseline≡\}. The corresponding \TEX\ parameter is set equal to the
specified dimension; \TEX\ remains in vertical mode, and the current vertical
list is not affected. This assignment is ``global,'' it
holds even after the end of a group. The initial default values
of these five parameters are $(324,504,3,0,10)$ points, respectively.
\b \<glueparam\>\<glue\>\qquad Define a glue parameter.
\⊃ Here \<glueparam\>\ stands for one of the control sequences
{\≡\lineskip≡\}, {\≡\baselineskip≡\}, {\≡\parskip≡\}, {\≡\dispskip≡\},
{\≡\dispaskip≡\}, {\≡\dispbskip≡\}, {\≡\topskip≡\}, {\≡\botskip≡\},
{\≡\tabskip≡\}. The corresponding \TEX\ parameter is set equal to the
specified glue; \TEX\ remains in vertical mode, and the current vertical
list is not affected. This assignment is ``local,'' it will be forgotten
at the end of the current group. The initial value for all
these types of glue is zero.
\b {\≡\chcode≡\}\<number$↓1$\>{\≡←≡\}\<number$↓2$\>\qquad
Define a character interpretation.
\⊃ The character whose seven-bit code is \<number$↓1$\>\ is subsequently
treated as being of category \<number$↓2$\>, where the category codes are
described in Chapter 7. This definition will be local to the current group.
\TEX\ remains in vertical mode, and the current vertical list is not affected.
\b {\≡\chpar≡\}\<number$↓1$\>{\≡←≡\}\<number$↓2$\>\qquad
Define an integer parameter.
\⊃ \TEX's internal parameter \<number$↓1$\>\ is set equal to \<number$↓2$\>.
Here is a table of the internal parameters:
$$\vbox{\halign{\ctr{#}\qquad⊗\hfill#\hfill\qquad⊗\rt{#}\qquad⊗\lft{#}\cr
Number⊗Name⊗Default value⊗Reference\cr
\noalign{\vskip 3pt}
0⊗{\≡\trace≡\}⊗\char'16 345⊗Chapter 27\cr
1⊗{\≡\jpar≡\}⊗2⊗Chapter 14\cr
2⊗hyphenation⊗50⊗Chapter 14\cr
3⊗doublehyphen⊗3000⊗Chapter 14\cr
4⊗widowline⊗80⊗Chapter 15\cr
5⊗brokenline⊗50⊗Chapter 15\cr
6⊗binopbreak⊗95⊗Chapters 14 & 18\cr
7⊗relbreak⊗50⊗Chapters 14 & 18\cr
8⊗{\≡\ragged≡\}⊗0⊗Chapter 14\cr
9⊗displaybreak⊗500⊗Chapter 15\cr}}$$
This definition will be local to the current group.
\TEX\ remains in vertical mode, and the current vertical list is not affected.
\bb {\≡\hangindent≡\}\<dimen\>$\left<\vcenter{\halign{\hfill#\hfill\cr
{\tt for }\<number\>\cr{\tt after }\<number\>\cr
\<nothing\>\cr}}\right>$\qquad Set up hanging indentation.
\⊃ This instruction causes a specified number of lines of the next
paragraph to be indented either at the left
margin or the right margin (see Chapter 14). \TEX\ remains in vertical mode,
and the current vertical list is not affected.
\b {\≡\output{≡\}\<vlist\>{\≡}≡\}\qquad Set the output routine.
\⊃ The specified \<vlist\>\ is stored for later use when pages
are output (see Chapter 23). \TEX\
remains in vertical mode, and the current vertical list is not affected.
This assignment is ``global,'' it will hold even after the end of the current
group.
\b {\≡\setcount≡\}\<digit\>\<optional
sign\>\<number\>\qquad Set a specified counter.
\⊃ One of ten counters, indicated by the specified digit,
is set to the specified integer value
(see Chapter 23). This assignment
is ``global,'' it is not rescinded at the end of a group.
\TEX\ remains in vertical mode, and the current vertical list is not affected.
\b {\≡\advcount≡\}\<digit\>\qquad Advance the specified counter.
\⊃ The magnitude of the specified counter is increased by 1.
\TEX\ remains in vertical mode, and the current vertical list is not affected.
\b {\≡\count≡\}\<digit\>\qquad Insert the specified counter.
\⊃ The specified counter is converted to characters (see Chapter 23)
and inserted into the input; this will cause \TEX\ to begin a new
paragraph as explained earlier.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\ifeven≡\}\<digit\>\cr{\≡\if≡\}\<char$↓1$\>\<char$↓2$\>\cr}}\right>
${\≡{≡\}\<true text\>{\≡
}\else{≡\}\<false text\>{\≡}≡\}\qquad Conditional text.
\⊃ \TEX\ reads either the true text or the false text, see Chapter 23.
\b {\≡\input ≡\}\<file name\>\<space\>\qquad Insert a file of text.
\⊃ The specified file of characters is inserted into the input at this
place. After the file has been read, \TEX\ will resume input at the present
position (unless {\≡\end≡\} occurred in that file).
\b {\≡\end≡\}\qquad Stop.
\⊃ (Not allowed in restricted vertical mode.)\xskip The current page is ejected,
followed if necessary by pages containing leftover material,
until there is nothing more to eject. Then if the last call on
the output routine produced only a null box---for example, two out of three
calls on the output routines at the end of Chapter 23 will do this---a
page containing an empty box of size {\≡\hsize≡\}$\times${\≡\vsize≡\}
is sent to the output routine, until either getting a nonnull output or until 25
consecutive null outputs have appeared. Then \TEX\ terminates: the output files are
tidied up, and a friendly warning message is issued if there
is an unmatched ``{\≡{≡\}'' still waiting for its ``{\≡}≡\}''.
\b {\≡\ddt≡\}\qquad Print debugging data.
\⊃ If bit 4 of the {\≡\trace≡\} parameter is 1, \TEX\ prints out its
current activities (the lists and pages it is currently
building).
Furthermore if bit \char'16 40 of the {\≡\trace≡\} parameter is 1, \TEX\ will
stop, giving you the chance to insert text on-line.
\TEX\ remains in vertical mode, and the current vertical list
is not affected.
\b \<anything else\>\qquad``{\tt ! You can't do that in vertical mode.}''
\⊃ If anything not listed above appears in vertical mode, you get an error
message. \TEX\ ignores the token of input that broke the rules, and remains in
vertical mode; the current vertical list is not affected.
\chapterbegin 25. {Summary of horizontal mode}
Here is a complete specification of everything you are allowed to type
in horizontal mode. This chapter and the adjacent two are intended to be a
concise and precise summary of what we have been discussing rather informally.
Perhaps it will be a useful reference when you're stuck and wondering
what \TEX\ allows you to do.
\def\<{$\langle$}\def\>{$\rangle$}
\ninepoint
\yskip
Chapter 13 explains the general idea of horizontal mode and restricted horizontal
mode. In both cases
\TEX\ is scanning an ``\<hlist\>'' and building a horizontal
list containing boxes and glue; this list might also contain other things
like penalty and insertion specifications. The
horizontal list is empty when \TEX\ first enters horizontal mode or restricted
horizontal mode, and it remains empty unless something is appended to it as
explained in the rules below.
For brevity the rules are stated for horizontal mode; the same rules apply to
restricted horizontal mode unless the contrary is specifically stated.
When \TEX\ is in horizontal mode, its next action depends on what it sees next,
according to the following possibilities:
\def\b{\yskip\textindent{$\bullet$}}
\def\bb{\yyskip\textindent{$\bullet$}}
\b \<unknown control sequence\>\qquad
``{\tt ! Undefined control sequence.}''
\⊃ For example, if you type ``{\≡r\Aole≡\}'' instead of ``{\≡r\A ole≡\}'',
and if {\≡\Aole≡\} hasn't been defined, you get an error message showing that
{\≡\Aole≡\} has just been scanned. To recover you can type ``{\tt i}'' (for
insertion); then (when prompted by ``{\tt*}'') type ``{\≡\A ole≡\}'' and
\<carriage-return\>, and \TEX\ will resume as if the mistake hadn't occurred.
\b \<defined control sequence\>\qquad Macro call.
\⊃ A control sequence that has been defined with {\≡\def≡\} or {\≡\gdef≡\},
for example a control sequence defined
in a book format such as Appendix B or Appendix E,
followed by its ``arguments'' (if any), will be replaced in the input as
explained in Chapter 20.
\b {\≡{≡\}\qquad Begin a new group.
\⊃ A new level of nomenclature begins, as explained in Chapter 5; a
matching {\≡}≡\} should appear later. The matching {\≡}≡\} usually occurs
in horizontal mode, but it might occur in vertical mode (after the end of
some paragraph). The beginning of a new group does not affect the current
horizontal list.
\b {\≡}≡\}\qquad End a group or an operation.
\⊃ The matching {\≡{≡\} is identified, and all intervening {\≡\def≡\}s,
{\≡\chcode≡\}s, {\≡\chpar≡\}s, font definitions,
and glue parameter definitions are forgotten. If the
matching {\≡{≡\} is the beginning of a group, \TEX\ remains in horizontal mode
and the current horizontal list is not affected. Otherwise \TEX\
finishes whatever the {\≡{≡\} marked the beginning of, or you get an
error message. The error messages are ``{\≡Too many }≡'s≡\}'', meaning that
there was no matching {\≡{≡\};
or ``{\≡Extra }≡\}'', meaning that
an unmatched right brace appears in the $\langle v↓n\rangle$ list of
some alignment preamble;
or ``{\≡Missing \cr inserted≡\}'', meaning that
the matching {\≡{≡\} was in ``{\≡\halign≡\}\<spec\>{\≡{≡\}''. In the former
cases the {\≡}≡\} is ignored; in the latter case a {\≡\cr≡\} is inserted.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
\<letter\>\cr\<nonmathletter\>\cr\<otherchar\>\cr}}\right>$\qquad
Append a character box.
\vskip 2pt
\⊃ Here \<letter\>\ normally means any of the characters {\tt A...Z}
and {\tt a...z}, and \<otherchar\>\ normally stands for any other character
that has not been given a special meaning like the special meanings often
assigned to {\≡$≡\} and {\≡⊗≡\} and \<carriage-return\>, etc. However,
{\≡\chcode≡\} can be used to reclassify any character, as explained in
Chapter 7. A \<nonmathletter\>\ is one of the control sequences {\≡\ss≡\},
{\≡\ae≡\}, {\≡\AE≡\}, {\≡\oe≡\}, {\≡\OE≡\}, {\≡\o≡\}, {\≡\O≡\}, mentioned
in Chapter 9. Each character has an associated
7-bit code that is used to select one of 128
characters from the current font.\xskip(If no current font has been defined, you
lose: \TEX\ will come to a grinding halt.)\xskip Information stored with the
current font is now examined to see whether or not this character is the
first of a ligature or kerned pair. If so, \TEX\ looks at the next
character; when a ligature is completed, the two characters are replaced by
a new character (as specified in the font) and this new character might in
turn be the first of another ligature or kerned pair.
In any event, a character box is appended to the current horizontal list;
and if a kerned pair is found, appropriate negative glue is appended next, in
such a way that the line-breaking and hyphenation algorithms will not be confused.
Furthermore if the character code is \char'16 055 (the code for ``\hbox{\tt-}'')
or if a ligature ends with this particular code, a ``{\≡\penalty 0≡\}'' is
automatically appended to the horizontal list. \TEX\ remains in horizontal mode.
\b {\≡\char≡\}\<number\>\qquad Append a character box.
\⊃ The \<number\>\ is reduced modulo 128, and \TEX\ proceeds just as
if an \<otherchar\>\ had just been scanned having this 7-bit code.
\b \<accent\>\<accentee\>\qquad Append an accented character.
\⊃ Here \<accent\>\ stands for one of the control sequences {\≡\≡`≡\},
{\≡\≡'≡\}, {\≡\A≡\}, {\≡\v≡\}, {\≡\u≡\}, {\≡\=≡\}, {\≡\"≡\}, {\≡\H≡\}, {\≡\b≡\},
{\≡\s≡\}, {\≡\t≡\}, {\≡\a≡\}, {\≡\l≡\}, {\≡\c≡\}, discussed in Chapter 9,
or for ``{\≡\accent≡\}\<number\>''; and \<accentee\>\ stands for either
\<letter\>\ or \<nonmathletter\>\ or \<otherchar\>\ or {\≡\char≡\}\<number\>,
possibly preceded by a new font definition ``{\≡\:≡\}\<font\>''. The accent and
accentee are made into character boxes, and the accent is superimposed on
the accentee, moving the accent left or right if necessary so that it is
centered (also taking into account the slantedness of the characters and
their heights, based on information stored with the fonts). Furthermore the
accent is raised or lowered in case the height of the accentee is different from the
``xheight'' of the accent's font (the height of lower case ``x''). The width of the
resulting box is the width of the accentee; this box is appended to the current
horizontal list, and \TEX\ remains in horizontal mode.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr\<space\>\cr{\≡\≡char'40≡\}\cr}}
\right>$\qquad Append variable space glue.
\⊃ Here \<space\>\ means either an explicit typed space or an implicit
one obtained at the end of a typed line.\xskip (Consecutive spaces are treated as
single spaces, and spaces are sometimes ignored, as explained in Chapter 7.)\xskip
The current font specifies what sort of glue should be inserted between words
of a paragraph when they are typeset in that font. The stretchability and
shrinkability of this glue is modified by the ``space factor,'' as explained
in Chapter 12, except that no modification is made when ``{\≡\≡char'40≡\}$\,$''
has been typed. \TEX\ appends the glue to its current horizontal list and
remains in horizontal mode.
\b {\≡\quad≡\}\qquad Append one quad of space.
\⊃ Space glue amounting to one quad in the current font is appended to
the current horizontal list. \TEX\ remains in horizontal mode.
\b {\≡\!≡\}\qquad Ignore space.
\⊃ \TEX\ looks at the next token of the input (expanding it if is
a defined control sequence), and discards it if it is a \<space\>. The
current horizontal list is not affected, and \TEX\ remains in horizontal mode.
\b {\≡\-≡\}\qquad Append discretionary hyphen.
\⊃ A ``discretionary'' hyphen is appended to the current horizontal list.
This means that the current place is a legal place to break a line, with
a specified penalty for hyphenation (see Chapter 14).
If the line actually breaks here, character number
\char'16 055 from the current font is inserted into the text, otherwise nothing
is inserted. \TEX\ remains in horizontal mode.
\b {\≡\/≡\}\qquad Append italic correction.
\⊃ If the final entry on the current horizontal list is not a
character box, you get an error message $$\hbox{\tt! Italic correction must
follow an explicit character.}$$ Otherwise an empty box whose width is the
italic correction for the corresponding character is appended to the
current horizontal list.\xskip (This information is stored in the font with
each character, except in ``{\tt ex} fonts''; don't try to use italic
correction with a character from an
{\tt ex} font.)\xskip\TEX\ remains in horizontal mode.
\b {\≡\vrule≡\}\<rule spec\>\qquad Append a vertical rule.
\⊃ The specified vertical line is appended to the current horizontal
list.\xskip(See Chapter 21 for further details.)\xskip
\TEX\ remains in horizontal mode.
\b \<box\>\qquad Append a box.
\⊃ Here \<box\>\ means one of the following:
$$\vbox{\halign{#\hfill\qquad⊗#\hfill\cr
{\≡\hbox≡\}\<spec\>{\≡{≡\}\<hlist\>{\≡}≡\}⊗box formed in restricted horizontal
mode\cr
{\≡\hbox par ≡\}\<dimen\>{\≡{≡\}\<hlist\>{\≡}≡\}⊗boxed paragraph in restricted
horizontal mode\cr
{\≡\vbox≡\}\<spec\>{\≡{≡\}\<vlist\>{\≡}≡\}⊗box formed in restricted vertical
mode\cr
{\≡\box≡\}\<digit\>⊗saved box (e.g., {\≡\box1≡\} was saved by {\≡\save1≡\})\cr
{\≡\page≡\}⊗current page (allowed only in output routines)\cr}}$$
And \<spec\>\ is one of the following:
$$\vbox{\halign{#\hfill\qquad⊗#\hfill\cr
{\tt to }\<dimen\>⊗desired width or height is specified\cr
{\tt to size}⊗width {\≡\hsize≡\} or height {\≡\vsize≡\}\cr
\<nothing\>⊗use natural width or height\cr
{\tt expand }\<dimen\>⊗augment natural width or height\cr}}$$
(Chapters 21 and 23 give further details.)\xskip The specified box is appended to
the current horizontal list, and \TEX\ resumes scanning in horizontal mode.\xskip
(After using {\≡\box≡\} or {\≡\page≡\}, that {\≡\box≡\} or {\≡\page≡\}
becomes null, so it can't be used twice.)
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\raise≡\}\cr{\≡\lower≡\}\cr}}\right>
$\<dimen\>\<box\>\qquad
Append a shifted box.
\⊃ The specified box is appended to the current horizontal list
as described above, but its contents are shifted up or down by the
specified amount.\xskip (The top and bottom edges of the shifted box are used to
compute the height and depth of the box ultimately constructed from the current
horizontal list, as explained in Chapter 21.)
\b {\≡\save≡\}\<digit\>\<box\>\qquad Save a box.
\⊃ The specified box is stored away for possible later use by
``{\≡\box≡\}\<digit\>''. Then \TEX\ resumes scanning in horizontal mode, having
made no change to its current horizontal list.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\hfill≡\}\cr{\≡\hskip≡\}\<glue\>\cr}}\right>$\qquad Append glue.
\⊃ The specified glue is appended to the current horizontal list.\xskip
(See Chapter 12 for details about glue.)\xskip\TEX\ remains in horizontal mode.
\bb {\≡\leaders≡\}$\left<\vcenter{\halign{\hfill#\hfill\cr
\<box\>\cr\<rule\>\cr}}\right>\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\hfill≡\}\cr
{\≡\hskip≡\}\<glue\>\cr}}\right>$\qquad Append leaders.
\⊃ The specified leaders are appended to the current horizontal list;
this will have an effect like the specified glue except that the box or rule will be
replicated in the resulting space (see Chapter 21). \TEX\ remains in horizontal
mode.
\b {\≡$≡\}\<formula\>{\≡$≡\}\qquad Append a math formula.
\⊃ The specified \<formula\>\ is scanned in math mode, as explained in
Chapter 26. This results in a horizontal list, which is appended to the
current horizontal list. Then \TEX\ resumes scanning in horizontal mode.
Mathematics fonts (the so-called {\tt rm} and {\tt it} and {\tt sy} and {\tt ex}
fonts) must have been defined earlier.
\b {\≡\par≡\}\qquad End of paragraph.
\⊃ (Ignored in restricted horizontal mode.)\xskip
If the current horizontal list is empty, nothing happens. Otherwise the
current horizontal list is ``justified'' using \TEX's line-breaking
routine described in Chapter 14; the resulting vertical list is appended to
the current vertical list of the page-builder, and \TEX\ continues in
vertical mode as described in Chapter 24.
\b {\≡$$≡\}\<display\>{\≡$$≡\}\qquad Interrupt paragraph for display.
\⊃ (Not allowed in restricted horizontal mode.)\xskip
The current horizontal list is converted to a vertical list just as
if a paragraph had ended, except that hanging indentation is not reset.
Then the \<display\>\ is processed, as explained in Chapter 26, resulting
in another vertical list that is given to the page-builder.\xskip (A displayed
formula counts as either two or three lines, with respect to the line count
in hanging indentation, depending on whether {\≡\dispaskip≡\} or {\≡\dispskip≡\}
glue is appended above the formula, cf.\ Chapter 19.)\xskip
Then \TEX\ returns to horizontal mode, ignoring a space if it follows the
closing ``{\≡$$≡\}''. At this point \TEX's current horizontal list will
be empty, so the paragraph will continue without indentation.
Mathematics fonts (the so-called {\tt rm} and {\tt it} and {\tt sy} and {\tt ex}
fonts) must have been defined earlier.
\b {\≡\penalty≡\}\<number\>\qquad Append a line break penalty.
\⊃
If the specified number is 1000 or more, line breaking is inhibited
here; otherwise this number is added to the badness when deciding whether to
break a line at this place. A negative penalty indicates a desirable place
to break.\xskip(See Chapter 15.)\xskip\TEX\ remains in horizontal mode.
\b {\≡\eject≡\}\qquad Force a page and line break.
\⊃ (Forces only a line break when in restricted horizontal mode.)\xskip
A new line will start at this place in the current horizontal list, and a new
page will start with this new line when it is appended to the page builder's
current vertical list, no matter how
``bad'' it may be to break a page or line here.\xskip(See the discussion in Chapter
14.) \TEX\ remains in horizontal mode.
\b \<stored mark\>\qquad Insert the text of a stored mark.
\⊃ (Here \<stored mark\>\ stands for one of the control sequences
{\≡\topmark≡\}, {\≡\botmark≡\}, or {\≡\firstmark≡\}. These are allowed
only in {\≡\output≡\} routines.)\xskip \TEX\ inserts the specified
mark text into its input; see Chapter 23.
\b {\≡\x≡\}\qquad Extension to \TEX.
\⊃ The control sequence {\≡\x≡\} allows special actions that might
exist in some versions of \TEX.\xskip(Such extensions are obtained by loading
a separately compiled module with the \TEX\ system; individual users might
have their own special extension modules.)
\b {\≡\valign≡\}\<spec\>{\≡{≡\}\<alignment preamble\>{\≡\cr≡\}\<alignment
entries\>{\≡}≡\}\hskip 20pt minus 20pt Append alignment.
\⊃ A horizontal list of aligned columns is constructed as
explained in Chapter 22, and this list is appended to the
current horizontal list. Then \TEX\ resumes scanning in horizontal mode.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡⊗≡\}\cr{\≡\cr≡\}\cr}}\right>$\qquad
Spurious alignment delimiter.
\⊃ The symbols {\≡⊗≡\} and {\≡\cr≡\} are detected deep inside \TEX's
scanning mechanism when they occur at the proper nesting level of braces, because
they cause \TEX\ to start scanning a ``\<$v↓j$\>'' as explained in Chapter 22.
Therefore if these symbols appear in horizontal mode, they are ignored, and you
get the error message ``{\≡There's no \halign or \valign going on.≡\}''
\b {\≡\ENDV≡\}\qquad End of alignment entry.
\⊃ An {\≡\ENDV≡\} instruction is inserted automatically by \TEX\ at the end
of each ``\<$v↓j$\>'' list of an alignment format.\xskip
(You can't actually give this
control sequence yourself; it only\eject % Good place to break, Feb. 25 1979
occurs implicitly.)\xskip
If the alignment entry involves an unmatched {\≡{≡\},
you get the message ``{\≡Missing } inserted.≡\}''
Otherwise \TEX\ finishes processing
this entry, by {\≡\hbox≡\}ing the current horizontal list,
and appends the resulting box to the current row of the current {\≡\halign≡\}.\xskip
(The {\≡\tabskip≡\} glue will also be inserted.)\xskip
If the present {\≡\ENDV≡\} corresponds to an alignment entry that was followed
by {\≡\cr≡\}, \TEX\ looks at the next part of the input as follows: Blank
spaces are ignored; ``{\≡\noalign{≡\}\<vlist\>{\≡}≡\}'' causes the \<vlist\>\ to
be processed in restricted vertical mode, and the resulting vertical list
is appended to the vertical list of the current {\≡\halign≡\}ment; ``{\≡}≡\}''
terminates the {\≡\halign≡\}; and anything else is assumed to begin the
next row of the alignment, so \<$u↓1$\>\ is inserted into the input.
On the other hand, if this {\≡\ENDV≡\} corresponds to an entry that was followed
by {\≡⊗≡\}, \TEX\ inserts \<$u↓{j+1}$\>\ into the input. In either case
\TEX\ remains in restricted horizontal
mode to process the new alignment entry, beginning with an empty horizontal list.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\topinsert≡\}\cr{\≡\botinsert≡\}\cr}}\right>
${\≡{≡\}\<vlist\>{\≡}≡\}\qquad Bound insertion of a vertical list.
\⊃ (Not allowed in restricted horizontal mode.)\xskip
\TEX\ reads the specified \<vlist\>\ in restricted vertical mode and constructs the
corresponding vertical list. This list will be inserted at the top or bottom
of the same page on which the line containing the present place in the
current horizontal list, followed by {\≡\topskip≡\} glue or
preceded by {\≡\botskip≡\} glue, respectively.\xskip(See Chapter 15; this
mechanism is intended primarily to accommodate illustrations and footnotes.)
If necessary,
two or more inserts will appear on the same page in first-in-first-out
order. Note that stretchable or shrinkable glue in the vertical list is not set
until the page is finally made up. After the specified list has been constructed
and stored in a safe place, \TEX\ resumes horizontal mode where it left off.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr {\≡\def≡\}\cr {\≡\gdef≡\}\cr}}\right>$
\<controlseq\>\<parameter text\>{\≡{≡\}\<result text\>{\≡}≡\}
\hskip 20pt minus 20pt Define a control sequence.
\⊃ The specified
control sequence is defined as described in Chapter 20. A \<space\>\ following
the definition will be ignored. \TEX\ remains
in horizontal mode, and the current horizontal list is not affected. You are not
allowed to redefine certain control sequences like {\≡\:≡\} and {\≡\baselineskip≡\},
because \TEX\ relies on these to control its operations at critical points.
Definitions with {\≡\def≡\} disappear at the end of the current group;
definitions with {\≡\gdef≡\} do not. It is best not to apply both {\≡\def≡\} and
{\≡\gdef≡\} to the same control sequence in different parts of a manuscript.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr {\≡\:≡\}\cr{\≡\mathex≡\}\cr}}\right>
$\<font\>\qquad Define the current font.
\⊃ The specified font code is selected; ``{\≡\:≡\}'' selects the current
font to be used in horizontal mode, as explained in Chapter 4, while
``{\≡\mathex≡\}'' selects the current {\tt ex} font to be used in mathematics mode,
as explained in Chapter 18. If this code is making its first
appearance in the manuscript
it must be followed by the font file name (see Chapter 4 and
Appendix S) followed by a space. Current font code selections
are ``local'' and will be
forgotten at the end of the current group. \TEX\ remains in horizontal mode, and
the current horizontal list is not affected.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\mathrm≡\}\cr{\≡\mathit≡\}\cr{\≡\mathsy≡\}\cr
}}\right>$\<font\>\<font\>\<font\>\qquad Define current math fonts.
\⊃ The specified font codes are selected, providing up to three sizes of
characters to be used in math formulas as explained in Chapter 18. If any font
code is making its first appearance in the manuscript, it must be followed by
the font file name (see Chapter 18 and Appendix S) followed by a space. Current
font code selections
are ``local'' and will be forgotten at the end of the current group.
\TEX\ remains in horizontal mode, and the current horizontal list is not affected.
\b \<dimenparam\>\<dimen\>\qquad Set a dimension parameter.
\⊃ Here \<dimenparam\>\ stands for one of the control sequences
{\≡\hsize≡\}, {\≡\vsize≡\}, {\≡\maxdepth≡\}, {\≡\parindent≡\},
{\≡\topbaseline≡\}. The corresponding \TEX\ parameter is set equal to the
specified dimension; \TEX\ remains in horizontal mode, and the current horizontal
list is not affected. This assignment is ``global,'' it
holds even after the end of a group. The initial default values
of these five parameters are $(324,504,3,0,10)$ points, respectively.
\b \<glueparam\>\<glue\>\qquad Define a glue parameter.
\⊃ Here \<glueparam\>\ stands for one of the control sequences
{\≡\lineskip≡\}, {\≡\baselineskip≡\}, {\≡\parskip≡\}, {\≡\dispskip≡\},
{\≡\dispaskip≡\}, {\≡\dispbskip≡\}, {\≡\topskip≡\}, {\≡\botskip≡\},
{\≡\tabskip≡\}. The corresponding \TEX\ parameter is set equal to the
specified glue; \TEX\ remains in horizontal mode, and the current horizontal
list is not affected. This assignment is ``local,'' it will be forgotten
at the end of the current group. The initial value for all
these types of glue is zero.
\b {\≡\chcode≡\}\<number$↓1$\>{\≡←≡\}\<number$↓2$\>\qquad
Define a character interpretation.
\⊃ The character whose seven-bit code is \<number$↓1$\>\ is subsequently
treated as being of category \<number$↓2$\>, where the category codes are
described in Chapter 7. This definition will be local to the current group.
\TEX\ remains in horizontal mode, and the current horizontal list is not affected.
\b {\≡\chpar≡\}\<number$↓1$\>{\≡←≡\}\<number$↓2$\>\qquad
Define an integer parameter.
\⊃ \TEX's internal parameter \<number$↓1$\>\ is set equal to \<number$↓2$\>.
Here is a table of the internal parameters:
$$\vbox{\halign{\ctr{#}\qquad⊗\hfill#\hfill\qquad⊗\rt{#}\qquad⊗\lft{#}\cr
Number⊗Name⊗Default value⊗Reference\cr
\noalign{\vskip 3pt}
0⊗{\≡\trace≡\}⊗\char'16 345⊗Chapter 27\cr
1⊗{\≡\jpar≡\}⊗2⊗Chapter 14\cr
2⊗hyphenation⊗50⊗Chapter 14\cr
3⊗doublehyphen⊗3000⊗Chapter 14\cr
4⊗widowline⊗80⊗Chapter 15\cr
5⊗brokenline⊗50⊗Chapter 15\cr
6⊗binopbreak⊗95⊗Chapters 14 & 18\cr
7⊗relbreak⊗50⊗Chapters 14 & 18\cr
8⊗{\≡\ragged≡\}⊗0⊗Chapter 14\cr
9⊗displaybreak⊗500⊗Chapter 15\cr}}$$
This definition will be local to the current group.
\TEX\ remains in horizontal mode, and the current horizontal list is not affected.
\bb {\≡\hangindent≡\}\<dimen\>$\left<\vcenter{\halign{\hfill#\hfill\cr
{\tt for }\<number\>\cr{\tt after }\<number\>\cr
\<nothing\>\cr}}\right>$\qquad Set up hanging indentation.
\⊃ This instruction causes a specified number of lines of the next
paragraph to be indented either at the left
margin or the right margin (see Chapter 14). In restricted horizontal mode, this
applies only to the paragraph being boxed, if any.
\TEX\ remains in horizontal mode,
and the current horizontal list is not affected.
\b {\≡\output{≡\}\<vlist\>{\≡}≡\}\<optional space\>\qquad Set the output routine.
\⊃ The specified \<vlist\>\ is stored for later use when pages
are output (see Chapter 23). \TEX\
remains in horizontal mode, and the current horizontal list is not affected.
This assignment is ``global,'' it will hold even after the end of the current
group.
\b {\≡\setcount≡\}\<digit\>\<optional
sign\>\<number\>\qquad Set a specified counter.
\⊃ One of ten counters, indicated by the specified digit,
is set to the specified integer value
(see Chapter 23). This assignment
is ``global,'' it is not rescinded at the end of a group.
\TEX\ remains in horizontal mode, and the current horizontal list is not affected.
\b {\≡\advcount≡\}\<digit\>\qquad Advance the specified counter.
\⊃ The magnitude of the specified counter is increased by 1.
\TEX\ remains in horizontal mode, and the current horizontal list is not affected.
\b {\≡\count≡\}\<digit\>\qquad Insert the specified counter.
\⊃ The specified counter is converted to characters (see Chapter 23)
and inserted into the input; \TEX\ will read it in horizontal mode.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\ifeven≡\}\<digit\>\cr{\≡\if≡\}\<char$↓1$\>\<char$↓2$\>\cr}}\right>
${\≡{≡\}\<true text\>
{\≡}\else{≡\}\<false text\>{\≡}≡\}\qquad Conditional text.
\⊃ \TEX\ reads either the true text or the false text, see Chapter 23.
Spaces following the ``{\≡{≡\}\<true text\>{\≡}≡\}'' and ``{\≡{≡\}\<false
text\>{\≡}≡\}'' are ignored.
\b {\≡\ddt≡\}\qquad Print debugging data.
\⊃ If bit 4 of the {\≡\trace≡\} parameter is 1, \TEX\ prints out its
current activities (the lists and pages it is currently
building).
Furthermore if bit \char'16 40 of the {\≡\trace≡\} parameter is 1, \TEX\ will
stop, giving you the chance to insert text on-line.
\TEX\ remains in horizontal mode, and the current horizontal list
is not affected.
\b \<anything else\>\qquad``{\tt ! You can't do that in horizontal mode.}''
\⊃ If anything not listed above appears in horizontal mode, you get an error
message. \TEX\ ignores the token of input that broke the rules, and remains in
horizontal mode; the current horizontal list is not affected.
\chapterbegin 26. {Summary of math mode}
Here is a complete specification of everything you are allowed to type
in math mode or display math mode.
This chapter and the previous two are intended to be a
concise and precise summary of what we have been discussing rather informally.
Perhaps it will be a useful reference when you're stuck and wondering
what \TEX\ allows you to do.
\def\<{$\langle$}\def\>{$\rangle$}
\ninepoint
\yskip
Chapter 13 explains the general idea of math mode and display math mode.
In both cases
\TEX\ is scanning an ``\<mlist\>'' and building a horizontal
list containing boxes, glue, and line-breaking information.
The \<mlist\>\ is called a \<display\>\ if it is scanned in display math mode,
a \<formula\>\ if scanned in ordinary math mode.
Mathematics processing actually takes place in two stages: first the entire
formula (up to the end of math mode) is input and made into a ``tree structure,''
then this tree is converted into the desired horizontal list. The reason for
doing the job in two steps is that \TEX's language makes it impossible in general
to determine the style for setting formulas as the formulas are being read in
(e.g., a subsequent ``{\≡\over≡\}'' might change everything). It is
convenient, however, to describe the rules below as if \TEX\ had clairvoyance,
knowing what style to use as it reads the input. Please keep in mind that
the correct style will be chosen for subformulas, according to the rules
in Chapters 17 and 18, even though the following description makes that
seem somewhat miraculous.
For brevity the rules below are stated for math mode; the same rules apply to
display math mode unless the contrary is specifically stated.
When \TEX\ is in math mode, its next action depends on what it sees next,
according to the following possibilities:
\def\b{\yskip\textindent{$\bullet$}}
\def\bb{\yyskip\textindent{$\bullet$}}
\b \<space\>\qquad Do nothing.
\⊃ This notation means: If \TEX\ is in math mode
and you type a blank
space, nothing happens and \TEX\ stays in math mode.\xskip(The end of a line
in an input file counts as a blank space, and so do certain other characters,
as explained in Chapter 7.)
\b \<unknown control sequence\>\qquad
``{\tt ! Undefined control sequence.}''
\⊃ For example, if you type ``{\≡\alfa≡\}'' instead of ``{\≡\alpha≡\}'',
and if {\≡\alfa≡\} hasn't been defined, you get an error message showing that
{\≡\alfa≡\} has just been scanned. To recover you can type ``{\tt i}'' (for
insertion); then (when prompted by ``{\tt*}'') type ``{\≡\alpha≡\}'' and
\<carriage-return\>, and \TEX\ will resume as if the mistake hadn't occurred.
\b \<defined control sequence\>\qquad Macro call.
\⊃ A control sequence that has been defined with {\≡\def≡\} or {\≡\gdef≡\},
for example a control sequence defined
in a book format such as Appendix B or Appendix E,
followed by its ``arguments'' (if any), will be replaced in the input as
explained in Chapter 20.
\b {\≡{≡\}\<mlist\>{\≡}≡\}\qquad Append a subformula.
\⊃ The \<mlist\>\ is processed in math mode and {\≡\hbox≡\}ed into a
box having its natural width. This box is then appended to the current
list as an ``Ord'' box.
Definitions inside the subformula are forgotten afterwards.
\b {\≡\left≡\}\<delim\>\<mlist\>{\≡\right≡\}\<delim\>\hskip 20pt minus 20pt
Append a subformula with variable delimiters.
\⊃ The \<mlist\>\ is processed in math mode, and surrounded by delimiters
of sufficient size to contain it, as explained in Chapter 18. The resulting list
is {\≡\hbox≡\}ed and appended to the current list as an ``Ord'' box.
Definitions inside the subformula are forgotten afterwards.
\b {\≡}≡\}\qquad ``{\≡Extra }.≡\}''
\⊃ The matching {\≡{≡\}, if any, lies outside the {\≡$≡\} or
{\≡\left≡\} that precedes the current \<mlist\>,
so an error message is issued and the {\≡}≡\} is ignored.
\b {\≡\right≡\}\qquad ``{\≡Extra \right.≡\}'' or ``{\≡Missing } inserted.≡\}''
\⊃ The matching {\≡\left≡\}, if any, lies outside the {\≡$≡\} or
{\≡{≡\} that preceded the current \<mlist\>, so an error message is
issued. \TEX\ automatically inserts a ``{\≡}≡\}'' if it appears to be missing.
\b {\≡$≡\}\qquad ``{\≡Missing \right. inserted.≡\}'' or ``{\≡Missing }
inserted.≡\}''
\⊃ The matching {\≡$≡\}, if any, lies outside the {\≡\left≡\} or
{\≡{≡\} that preceded the current \<mlist\>, so an error message is
issued and \TEX\ automatically inserts what it assumes was missing.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
\<letter\>\cr\<mathchar\>\cr\<otherchar\>\cr}}\right>$\qquad
Append a character box.
\vskip 2pt
\⊃ Here \<letter\>\ normally means any of the characters {\tt A...Z}
and {\tt a...z}, and \<otherchar\>\ normally stands for any other character
that has not been given a special meaning like the special meanings often
assigned to {\≡$≡\} and {\≡⊗≡\} and \<carriage-return\>, etc. However,
{\≡\chcode≡\} can be used to reclassify any character, as explained in
Chapter 7. A \<mathchar\>\ is one of the many control sequences {\≡\alpha≡\},
{\≡\beta≡\}, etc.\ listed in Appendix F. Each \<mathchar\>\ has an associated
9-bit code that is used to select one of 512 characters from \TEX's current
math fonts
in the desired size; each \<letter\>\ and \<otherchar\>\ also has an associated
9-bit code, determined from its 7-bit code by using a table in Appendix F.
Each character also has an associated category (Ord or Op or Bin, etc.), as
explained in Chapter 18 and Appendix F; these categories are used to determine
spacing and line-breaking. The character box is appended to the current list
and \TEX\ continues scanning in math mode.\xskip(Note: The italic correction is
included when computing the width of this box. However, it will be removed
by \TEX\ if this box has a subscript but no superscript; thus, subscripts will
be closer to letters like ``$P$''. The spacing on \TEX's math fonts is intended
to make formulas look right when typeset by \TEX's rules, so it is quite
different from spacing that makes text look right; cf.\ the examples of fonts
cmi10 and cmti10 in Chapter 18.)
\b {\≡\char≡\}\<number\>\qquad Append a character box.
\⊃ The \<number\>\ is reduced modulo 512, and \TEX\ proceeds just as
if a \<mathchar\>\ of category Ord has just been scanned having this 9-bit code.
\b {\≡↑≡\}\<atom\>\qquad Superscript the previous box.
\⊃
(Here and in two rules that follow, an \<atom\>\ is either a single character
(i.e., \<letter\>\ or \<mathchar\>\ or \<otherchar\>\ or {\≡\char≡\}\<number\>)
or a subformula of the form ``{\≡{≡\}\<mlist\>{\≡}≡\}''. Atoms may be regarded
as rigid boxes that will be combined to build up larger formulas.)\xskip
If the last element of the current list is not a box, append a null box.
Otherwise if
the last box of the current list has already been superscripted, report a
``{\tt Double superscript}'' error. Attach the box corresponding to the \<atom\>\
as the superscript of the last box of the current list.
\b {\≡≡↓≡\}\<atom\>\qquad Subscript the previous box.
\⊃ Subscripting is entirely analogous to superscripting.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
\<mathcontrol\>\cr\<accent\>\cr}}\right>$\<atom\>\qquad Build up a formula.
\⊃ Here \<mathcontrol\>\ stands for one of the nine control sequences
{\≡\sqrt≡\}, {\≡\underline≡\}, {\≡\overline≡\}, {\≡\mathop≡\}, {\≡\mathbin≡\},
{\≡\mathrel≡\}, {\≡\mathopen≡\}, {\≡\mathclose≡\}, {\≡\mathpunct≡\}; and
\<accent\>\ stands for one of the control sequences {\≡\≡`≡\},
{\≡\≡'≡\}, {\≡\A≡\}, {\≡\v≡\}, {\≡\u≡\}, {\≡\=≡\}, {\≡\"≡\}, {\≡\H≡\}, {\≡\b≡\},
{\≡\s≡\}, {\≡\t≡\}, {\≡\a≡\}, {\≡\l≡\}, {\≡\c≡\}, discussed in Chapter 9,
or for ``{\≡\accent≡\}\<number\>''.\xskip
(The \<number\>\ in the latter case is reduced modulo 512.)\xskip
Each of these does something to the
box formed from the \<atom\>: {\≡\sqrt≡\} inserts a variable-size radical sign
in front of the box and a line over the box (and a little blank space above that
line); {\≡\underline≡\} and {\≡\overline≡\} insert a line and a little blank
space under or over the box; the control sequences
{\≡\mathop≡\}, $\ldotss$, {\≡\mathpunct≡\} are simply used to
classify the box as type Op, $\ldotss$, Punct, respectively; and an accent is
centered over the box.\xskip (Accents in horizontal mode are corrected for slant,
but in math mode they are simply centered; in both cases they are raised or lowered
by the same amount when applied to the same letter.)\xskip The box resulting from
the specified operation is appended to the current list, and \TEX\ continues in
math mode.
\b \<mathglue\>\qquad Append glue based on the current style.
\⊃ Here \<mathglue\>\ means one of the control sequences {\≡\,≡\},
{\≡\≡char'40≡\}, {\≡\>≡\}, {\≡\;≡\}, {\≡\quad≡\}, {\≡\≡≥≡\}, {\≡\!≡\}, {\≡\?≡\},
{\≡\<≡\}, {\≡\≡≤≡\}, described in Chapter 18. The corresponding glue is appended
to the current list, and \TEX\ continues in math mode.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\hfill≡\}\cr{\≡\hskip≡\}\<glue\>\cr}}\right>$\qquad Append explicit glue.
\⊃ The specified glue is appended to the current list.\xskip
(See Chapter 12 for details about glue, and see Chapter 17 for an example of
{\≡\hfill≡\} used in the numerator of a formula.)\xskip\TEX\ remains in math mode.
\b \<box\>\qquad Append a box.
\⊃ Here \<box\>\ means one of the following:
$$\vbox{\halign{#\hfill\qquad⊗#\hfill\cr
{\≡\hbox≡\}\<spec\>{\≡{≡\}\<hlist\>{\≡}≡\}⊗box formed in restricted horizontal
mode\cr
{\≡\hbox par ≡\}\<dimen\>{\≡{≡\}\<hlist\>{\≡}≡\}⊗boxed paragraph in restricted
horizontal mode\cr
{\≡\vbox≡\}\<spec\>{\≡{≡\}\<vlist\>{\≡}≡\}⊗box formed in restricted vertical
mode\cr
{\≡\box≡\}\<digit\>⊗saved box (e.g., {\≡\box1≡\} was saved by {\≡\save1≡\})\cr
{\≡\page≡\}⊗current page (allowed only in output routines)\cr}}$$
And \<spec\>\ is one of the following:
$$\vbox{\halign{#\hfill\qquad⊗#\hfill\cr
{\tt to }\<dimen\>⊗desired width or height is specified\cr
{\tt to size}⊗width {\≡\hsize≡\} or height {\≡\vsize≡\}\cr
\<nothing\>⊗use natural width or height\cr
{\tt expand }\<dimen\>⊗augment natural width or height\cr}}$$
(Chapters 21 and 23 give further details.)\xskip The specified box is appended to
the current list as an Ord box, and \TEX\ resumes scanning in math mode.\xskip
(After using {\≡\box≡\} or {\≡\page≡\}, that {\≡\box≡\} or {\≡\page≡\}
becomes null, so it can't be used twice.)
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\raise≡\}\cr{\≡\lower≡\}\cr}}\right>
$\<dimen\>\<box\>\qquad
Append a shifted box.
\⊃ The specified box is appended to the current list
as described above, but its contents are shifted up or down by the
specified amount.
\b {\≡\save≡\}\<digit\>\<box\>\qquad Save a box.
\⊃ The specified box is stored away for possible later use by
``{\≡\box≡\}\<digit\>''. Then \TEX\ resumes scanning in math mode, having
made no change to its current list.
\eject % Good place to break (Feb 25, 1979)
\b {\≡\*≡\}\qquad Append discretionary times sign.
\⊃ A ``discretionary'' $\times$ is appended to the current list.
This means that the current place is a legal place to break a line, with
a specified penalty for hyphenation (see Chapter 14).
If the line actually breaks here, character number
\char'16 402 from the current font is inserted into the text; otherwise nothing
is inserted. \TEX\ remains in math mode.
\b {\≡\limitswitch≡\}\qquad Change convention on displayed limits.
\⊃(Allowed only when the last item in the current list is an Op box; has an
effect only when setting a formula in display style.) \TEX's normal convention
for typesetting the ``limits'' (i.e., the superscript and subscript) of an
operator in display style is to center them above and below the Op box---unless
that Op box is a single character in the current {\tt ex} font having a nonzero
``italic correction'' in the font; in the latter case the subscripts and
superscripts are normally set to the right as usual. But {\≡\limitswitch≡\} has
the effect of reversing these conventions on the current operator:
centering changes to placement at the
right and vice versa. \TEX\ remains in math mode.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\over≡\}\cr{\≡\above≡\}\<dimen\>\cr{\≡\atop≡\}\cr}}\right>$\qquad Separate
numerator from denominator.
\⊃ If a numerator has previously been set aside for the current
formula, give an error message $$\hbox{\≡! Ambiguous; you need another { and
}.≡\}$$ and ignore the input. Otherwise the current list is set aside to be
the numerator, and the list after this point until the end of the formula
will be the denominator.
Afterwards the numerator will be centered over the denominator, essentially
by inserting the glue ``{\≡\hskip 0pt plus 100000pt≡\}'' at the left and right
of whichever one has less natural width and {\≡\hbox≡\}ing it to the
width of the other. The fraction line inserted between them will be at the
height of the ``axis'' of the overall formula (a position specified in the
{\tt sy} font of the appropriate size).
The current {\tt ex} font specifies a ``default rule
thickness'' to be used for the ruled lines in {\≡\sqrt≡\}, {\≡\underline≡\},
and {\≡\overline≡\}; this same thickness is used for the fraction line in
{\≡\over≡\}, while {\≡\above≡\} lets you specify any desired thickness.\xskip (See
the examples in Chapter 17.)\xskip The
thickness is zero for {\≡\atop≡\}, i.e., there is no fraction line at all;
in this case, the positioning of numerator and denominator is somewhat different
in order to take advantage of the extra flexibility.
A little extra space is attached to the left and right of the formula after
the numerator and denominator have been pasted together.
\b {\≡\comb≡\}\<delim\>\<delim\>\qquad Build a combinatorial formula.
\⊃ This is like {\≡\atop≡\}, except that the specified delimiters are
placed at the left and right of the formula after the numerator and
denominator have been positioned.\xskip (In fact, ``{\≡\atop≡\}'' is precisely
equivalent to ``{\≡\comb..≡\}''.)\xskip\TEX\ chooses the size of the delimiters
based only on the current style, regardless of the sizes of numerator
and denominator.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\vcenter≡\}\cr{\≡\vtop≡\}\cr}}\right>$\qquad Append a centered or top-adjusted
box.
\⊃ The specified vertical list is constructed in restricted vertical
mode, then it is {\≡\vbox≡\}ed and the resulting box is moved up or down
so that ({\≡\vcenter≡\}) it is centered vertically just as large delimiters are,
or ({\≡\vtop≡\}) the baseline
of the topmost box in the vertical list coincides with the baseline of the formula.
Then \TEX\ resumes its activities in math mode.
\b {\≡\penalty≡\}\<number\>\qquad Append a line break penalty.
\⊃ (This has no effect in a subformula or a displayed formula.)\xskip
If the specified number is 1000 or more, line breaking is inhibited
here; otherwise this number is added to the badness when deciding whether to
break a line at this place. A negative penalty indicates a desirable place
to break.\xskip (See Chapter 15.)
If this penalty is specified immediately following a Bin or
Rel box, it overrides the penalty ordinarily placed there (see Chapter 18).
\TEX\ remains in math mode.
\b {\≡\eject≡\}\qquad Force a page and line break.
\⊃ (This has no effect in a subformula or a displayed formula.)\xskip
A new line will start at this place in the current horizontal list, and a new
page will start with this new line when it is appended to the page builder's
current vertical list, no matter how
``bad'' it may be to break a page or line here.\xskip(See the discussion in Chapter
14.)\xskip\TEX\ remains in math mode.
\b \<mathstyle\>\qquad Define the current style.
\⊃ Here \<mathstyle\>\ stands for one of the control sequences
{\≡\dispstyle≡\}, {\≡\textstyle≡\}, {\≡\scriptstyle≡\}, {\≡\scriptscriptstyle≡\}
discussed in Chapter 17. The specified style will apply from this point on, until it
is redefined or until the end of
the current formula or subformula. \TEX\ remains in math mode.
\b {\≡\eqno≡\}\qquad Separate a display from its equation number.
\⊃ (Allowed only in display math mode.)\xskip The current list is converted
to a displayed formula and saved away in a safe place; \TEX\ now switches to
non-display math mode. The subsequent \<mlist\>\ will become an equation number,
placed at the right of the display as explained in Chapter 19.
\b {\≡\x≡\}\qquad Extension to \TEX.
\⊃ The control sequence {\≡\x≡\} allows special actions that might
exist in some versions of \TEX.\xskip (Such extensions are obtained by loading
a separately compiled module with the \TEX\ system; individual users might
have their own special extension modules.)
\b \<stored mark\>\qquad Insert the text of a stored mark.
\⊃ (Here \<stored mark\>\ stands for one of the control sequences
{\≡\topmark≡\}, {\≡\botmark≡\}, or {\≡\firstmark≡\}. These are allowed
only in {\≡\output≡\} routines.)\xskip \TEX\ inserts the specified
mark text into its input; see Chapter 23.
\b {\≡\halign≡\}\<spec\>{\≡{≡\}\<alignment preamble\>{\≡\cr≡\}\<alignment
entries\>{\≡}≡\}\hskip 20pt minus 20pt Append alignment.
\⊃ This is allowed only in display math mode, and only if there are
no formulas being displayed outside of this alignment and no {\≡\eqno≡\}.
The behavior is identical
to {\≡\halign≡\} when it appears in vertical mode, except that {\≡\dispskip≡\}
glue is appended above and below the resulting vertical list.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡⊗≡\}\cr{\≡\cr≡\}\cr}}\right>$\qquad
Spurious alignment delimiter.
\⊃ The symbols {\≡⊗≡\} and {\≡\cr≡\} are detected deep inside \TEX's
scanning mechanism when they occur at the proper nesting level of braces, because
they cause \TEX\ to start scanning a ``\<$v↓j$\>'' as explained in Chapter 22.
Therefore if these symbols appear in math mode, they are ignored, and you
get the error message ``{\≡There's no \halign or \valign going on.≡\}''
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\ENDV≡\}\cr{\≡\par≡\}\cr}}\right>$\qquad ``{\≡Missing $ inserted.≡\}''
\⊃ An {\≡\ENDV≡\} instruction is inserted automatically by \TEX\ at the end
of each ``\<$v↓j$\>'' list of an alignment format.\xskip
(You can't actually give this
control sequence yourself; it only occurs implicitly.)\xskip
A {\≡\par≡\} token occurs either implicitly, as a result of a blank line
in the input, or explicitly. Neither case should happen in math mode, so \TEX\
issues an error message and inserts a {\≡$≡\} in an attempt to keep going.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr {\≡\def≡\}\cr {\≡\gdef≡\}\cr}}\right>$
\<controlseq\>\<parameter text\>{\≡{≡\}\<result text\>{\≡}≡\}
\hskip 20pt minus 20pt Define a control sequence.
\⊃ The specified
control sequence is defined as described in Chapter 20.
\TEX\ remains in math mode, and the current list is not affected. You are not
allowed to redefine certain control sequences like {\≡\baselineskip≡\} and {\≡\:≡\},
since \TEX\ relies on these to control its operations at critical points.
Definitions with {\≡\def≡\} disappear at the end of the current formula or
subformula;
definitions with {\≡\gdef≡\} do not. It is best not to apply both {\≡\def≡\} and
{\≡\gdef≡\} to the same control sequence in different parts of a manuscript.
\b \<dimenparam\>\<dimen\>\qquad Set a dimension parameter.
\⊃ Here \<dimenparam\>\ stands for one of the control sequences
{\≡\hsize≡\}, {\≡\vsize≡\}, {\≡\maxdepth≡\}, {\≡\parindent≡\},
{\≡\topbaseline≡\}. The corresponding \TEX\ parameter is set equal to the
specified dimension; \TEX\ remains in math mode, and the current
list is not affected. This assignment is ``global,'' it
holds even after the end of the current formula. The initial default values
of these five parameters are $(324,504,3,0,10)$ points, respectively.
\b \<glueparam\>\<glue\>\qquad Define a glue parameter.
\⊃ Here \<glueparam\>\ stands for one of the control sequences
{\≡\lineskip≡\}, {\≡\baselineskip≡\}, {\≡\parskip≡\}, {\≡\dispskip≡\},
{\≡\dispaskip≡\}, {\≡\dispbskip≡\}, {\≡\topskip≡\}, {\≡\botskip≡\},
{\≡\tabskip≡\}. The corresponding \TEX\ parameter is set equal to the
specified glue; \TEX\ remains in math mode, and the current
list is not affected. This assignment is ``local,'' it will be forgotten
at the end of the current formula or subformula; so this construction is
of very limited utility in math mode. The initial value for all
these types of glue is zero.
\b {\≡\chcode≡\}\<number$↓1$\>{\≡←≡\}\<number$↓2$\>\qquad
Define a character interpretation.
\⊃ The character whose seven-bit code is \<number$↓1$\>\ is subsequently
treated as being of category \<number$↓2$\>, where the category codes are
described in Chapter 7. This definition will be local to the current formula or
subformula.
\TEX\ remains in math mode, and the current list is not affected.
\b {\≡\chpar≡\}\<number$↓1$\>{\≡←≡\}\<number$↓2$\>\qquad
Define an integer parameter.
\⊃ \TEX's internal parameter \<number$↓1$\>\ is set equal to \<number$↓2$\>.
See Chapter 25 for a table of the internal parameters. This definition will be
local to the current formula or subformula, and any new settings of ``binopbreak''
and ``relbreak'' will disappear before \TEX\ uses them in the present formula,
so they are best defined {\sl outside} of math mode.
\TEX\ remains in math mode, and the current list is not affected.
\b {\≡\output{≡\}\<vlist\>{\≡}≡\}\<optional space\>\qquad Set the output routine.
\⊃ The specified \<vlist\>\ is stored for later use when pages
are output (see Chapter 23). \TEX\
remains in math mode, and the current list is not affected.
This assignment is ``global,'' it will hold even after the end of the current
formula.
\b {\≡\setcount≡\}\<digit\>\<optional
sign\>\<number\>\qquad Set a specified counter.
\⊃ One of ten counters, indicated by the specified digit,
is set to the specified integer value
(see Chapter 23). This assignment
is ``global,'' it is not rescinded at the end of the formula.
\TEX\ remains in math mode, and the current list is not affected.
\b {\≡\advcount≡\}\<digit\>\qquad Advance the specified counter.
\⊃ The magnitude of the specified counter is increased by 1.
\TEX\ remains in math mode, and the current list is not affected.
\b {\≡\count≡\}\<digit\>\qquad Insert the specified counter.
\⊃ The specified counter is converted to characters (see Chapter 23)
and inserted into the input; \TEX\ will read it in math mode.
\bb $\left<\vcenter{\halign{\hfill#\hfill\cr
{\≡\ifeven≡\}\<digit\>\cr{\≡\if≡\}\<char$↓1$\>\<char$↓2$\>\cr}}\right>
${\≡{≡\}\<true text\>
{\≡}\else{≡\}\<false text\>{\≡}≡\}\qquad Conditional text.
\⊃ \TEX\ reads either the true text or the false text, see Chapter 23.
\b {\≡\ddt≡\}\qquad Print debugging data.
\⊃ If bit 4 of the {\≡\trace≡\} parameter is 1, \TEX\ prints out its
current activities (the lists and pages it is currently
building).
Furthermore if bit \char'16 40 of the {\≡\trace≡\} parameter is 1, \TEX\ will
stop, giving you the chance to insert text on-line.
\TEX\ remains in math mode, and the current list
is not affected.
\b \<anything else\>\qquad``{\tt ! You can't do that in math mode.}''
\⊃ If anything not listed above appears in math mode, you get an error
message. \TEX\ ignores the token of input that broke the rules, and remains in
math mode; the current list is not affected.
\chapterbegin 27. {Recovery from errors}
\def\<{$\langle$}\def\>{$\rangle$}
OK, everything you need to know about \TEX\ has been explained---unless you
happen to be fallible.
If you don't plan to make any errors, don't bother to read this chapter. Otherwise
you might find it helpful to make use of some of the ways \TEX\ tries to pinpoint
bugs in your manuscript.
In the trial runs you did when reading Chapter 6, you learned the general form
of error messages, and you also learned the various ways you can respond to
\TEX's complaints.
With practice, you will be able to correct most errors ``on line,''
as soon as \TEX\ has detected them, by inserting and deleting a few things.
On the other hand, some errors are more devastating than others; one error
might cause some other perfectly valid construction
to seem wrong. Furthermore, \TEX\ doesn't always diagnose your errors correctly,
since it is a rather simple-minded computer program that doesn't readily
understand what you have in mind.\xskip (In other words, let's face it: \TEX\ can
get hopelessly confused.)
By looking at the input context that follows an error message, you can often
tell what \TEX\ will read next if you proceed by hitting
\<carriage-return\>. For example, look again at the error message discussed
at the end of Chapter 6; it shows that \TEX\ is about to read ``{\tt STORY}'',
then (since the {\tt<argument>} will be finished) will come ``{\≡\hskip
0pt≡\}'' and so on. Here's another example:
$$\vbox{\halign{#\hfill\cr
{\≡! Missing { inserted.≡\}\cr
{\≡<to be read again>≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ A≡\}\cr
{\≡(*) \hbox A≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ nother example.≡\}\cr}}$$
In this case \TEX\ has read the ``{\tt A}'' and discovered that a ``{\≡{≡\}''
was missing. The missing left brace has been inserted and the ``{\tt A}'' will
be read again, followed by ``{\tt nother example.}'' If you understand
what \TEX\ has read and is going to read next, you will be able to make good
use of the insertion and deletion options when error messages appear on your
terminal, because you'll be able to make corrections before an error propagates.
Here is a complete list of the messages you might get from \TEX, presented
in alphabetic order for reference purposes.
Each message is followed by a brief explanation of the
problem, from \TEX's viewpoint, and of any remedial action you might want to take.\!
\xskip(See also Appendix I.)
\yskip\noindent{\≡! A box specification was supposed to be here.≡\}
\⊃ \TEX\ was expecting to see a \<box\>\ now, based on what it had recently
seen (e.g., ``{\≡\raise≡\}'' or ``{\≡\save≡\}'' or ``{\≡\leaders≡\}''), but
what it now sees is not the beginning of a \<box\>.\xskip(See Chapter 24 or 25 or 26
for the definition of a \<box\>.)\xskip
Proceed, and \TEX\ will forget whatever led it
to expect a \<box\>.
\yskip\noindent{\≡! Ambiguous; you need another { and }.≡\}
\⊃ You seem to be using {\≡\over≡\} or {\≡\atop≡\} or {\≡\above≡\} or
{\≡\comb≡\} more than once in the same formula or subformula. Proceed, and
the formula will appear as if the current {\≡\over≡\} (or whatever) weren't there.
\yskip\noindent{\≡! All mixed up, can't continue.≡\}
\⊃ \TEX\ is quitting, because it is confused about an alignment that has
gone awry.
\yskip\noindent{\≡! Argument of ≡\}\<control sequence\>{\≡≡ can't begin with }.≡\}
\⊃The first character of some argument to the specified macro is {\≡}≡\}. Proceed,
and this {\≡}≡\} will be ignored.
\yskip\noindent{\≡! Bad font link for large delimiter ≡\}\<number\>{\≡.≡\}
\⊃ \TEX\ is trying to make a variable-size delimiter, but either you
gave it the wrong code number or the font information of the current {\tt ex} font
is messed up. Maybe the wrong {\tt ex} font has been selected.
Proceed, and the delimiter will be changed to ``.'' (blank).
\yskip\noindent{\≡! Blank space should follow file name.≡\}
\⊃ \TEX\ usually continues to read a file name until seeing a blank space,
so it may have incorporated part of your input text into the file name. Proceed
and you might be lucky.
\yskip\noindent{\≡! Display math should end with $$.≡\}
\⊃ \TEX\ got to a {\≡$≡\} in display math mode, and it wasn't followed
by another {\≡$≡\}. If you simply have typed a single dollar sign instead of
a double one, proceed and \TEX\ will happily pretend there were two. Otherwise
you're probably in deep trouble---but don't give up yet.\xskip
(Perhaps you didn't want \TEX\ to get into
display math mode at all; are you doing an alignment with ``{\≡$#$≡\}'' in
some format, where the entry to be aligned is empty, contrary to the advice in
Chapter 22?)
\yskip\noindent{\≡! Double subscript.≡\}
\⊃ You can't apply {\≡≡↓≡\} twice to the same thing. Proceed, and the
first subscript will be ignored.
\yskip\noindent{\≡! Double superscript.≡\}
\⊃ You can't apply {\≡↑≡\} twice to the same thing. Proceed, and the
first superscript will be ignored.
\yskip\noindent{\≡! \else required here.≡\}
\⊃ \TEX\ is processing conditional code initiated by {\≡\if≡\} or
{\≡\ifeven≡\}, and the condition was false, so the \<true text\>\ has
just been skipped over. But the next token was not {\≡\else≡\}; perhaps
the \<true text\>\ contains improper grouping of braces. Proceed, and \TEX\
will resume reading the input.
\yskip\noindent{\≡(\end occurred on level ≡\}\<number\>{\≡).≡\}
\⊃ This message may appear on your terminal just before \TEX\ signs off;
it warns you that the stated number of {\≡{≡\}'s still is waiting to be
matched.
\yskip\noindent{\≡! Extra ≡\}\<something\>.
\⊃ There are several messages telling you that your input text contains
something ``extra''; for example, if your input contains a math formula
like ``{\≡$x}+y$≡\}'', \TEX\ will say that you have an extra ``{\≡}≡\}''.
Proceed, and \TEX\ will ignore what it claims is extra.\xskip(If you forget to type
``{\≡\cr≡\}'' in an alignment, you may get the message ``{\≡Extra alignment
tab≡\}'', meaning
that there are more tabs than specified in the preamble. Your alignment will
probably be messed up and overfull boxes will appear; it's too bad.)
\yskip\noindent{\≡! First use of font must define it.≡\}
\⊃ A font code has appeared for the first time in your manuscript, and
it wasn't immediately followed by ``{\tt=}'' or ``{\tt←}''.\xskip(This is a rather
serious error---always make it a habit to declare your fonts early in your
manuscript.)\xskip Insert ``{\tt=}\<font file name\>\<space\>'' and \TEX\ will be
able to continue.
\yskip\noindent{\≡! \halign in math mode must be preceded and followed by $$.≡\}
\⊃ \TEX\ has just scanned the ``{\≡}≡\}'' that completes an {\≡\halign≡\}
in display math mode. You get this error if a nonempty formula preceded the
{\≡\halign≡\} or if the current item of input isn't ``{\≡$≡\}''. Proceed, and
\TEX\ will continue in display math mode.\xskip (Strange things may happen.)
\yskip\noindent{\≡! Illegal font code.≡\}
\⊃ You should always refer to fonts as suggested in Chapter 4; for example,
you shouldn't type crazy things like ``{\≡\:\hbox≡\}'' unless you have
redefined the control sequence {\≡\hbox≡\}. Insert the font code you
intended, by first typing ``{\tt i}''.
\yskip\noindent{\≡! Illegal parameter number in definition of ≡\}\<controlseq\>.
\⊃ The result text of the stated definition contains an appearance of
{\≡#≡\} that isn't followed by {\≡#≡\} or by the number of a parameter in the
parameter text. Proceed, and \TEX\ will assume that you meant to type ``{\≡##≡\}''.
\yskip\noindent{\≡! Illegal unit of measure (pt inserted).≡\}
\⊃ \TEX\ is scanning a \<dimen\>\ (see Chapter 10), but the \<number\>\
isn't followed by any of the two-letter codes \TEX\ knows. Proceed, and \TEX\
will assume that ``{\tt pt}'' was there.
\yskip\noindent{\≡! Improper code.≡\}
\⊃ You are attempting to use {\≡\chcode≡\} or {\≡\chpar≡\} with
an improper \<number$↓1$\>. The operation is aborted, but you may proceed.
\yskip\noindent{\≡! Input page ended while scanning def of ≡\}\<controlseq\>.
\⊃ The \<parameter text\>\ or the \<result text\>\ of a {\≡\def≡\}, or
the \<mark list\>\ of a {\≡\mark≡\}, or the \<vlist\>\ of an {\≡\output≡\}, has
extended beyond the current file page of the input file. This probably means that
you forgot a ``{\≡}≡\}'' in some faraway part of the input manuscript,
so it's probably a disaster.
Insert a right brace if you want, and proceed if you dare.
\yskip\noindent{\≡! Input page ended while scanning use of ≡\}\<controlseq\>.
\⊃This message has been preceded by a ``{\tt Runaway argument?}'' message that
shows what \TEX\ thinks is the beginning of
an argument to a defined control sequence. For
some reason, a file page in the input file has ended before the text of that
argument has ended. This probably is a serious error, because it has presumably
gone undetected for a while. You can try to insert something into the input
that will terminate the runaway argument, but you most likely should start over,
after fixing the argument so that it terminates where it should.\xskip
(You probably left out a ``{\≡}≡\}''.)
\yskip\noindent{\≡! Large delimiter ≡\}\<number\>{\≡≡ should be in mathex font.≡\}
\⊃ You are specifying a \<delim\>\ by a 9-bit code, but
you should have specified
either $c↓2=0$ or $c↓2≥\null$\char'16 600. Proceed, and the
delimiter will be selected using $c↓1$ only.\xskip (See Chapter 18 for the
meaning of $c↓1$ and $c↓2$.)
\yskip\noindent{\≡! Italic correction must follow an explicit character.≡\}
\⊃ The control sequence {\≡\/≡\} is supposed to follow a character
from some font, but your input tells \TEX\ to apply an ``italic correction''
to something else. Perhaps you are using a defined control sequence that
slants one of its arguments (e.g., {\≡\algbegin≡\} in Appendix E), where the
argument ends with a math formula instead of a word. Proceed.
\yskip\noindent{\≡! Limit switch must follow math operator.≡\}
\⊃ If the control sequence
{\≡\limitswitch≡\} doesn't follow an Op box, it doesn't accomplish anything.
Proceed.
\yskip\noindent{\≡! Lookup failed on file ≡\}\<filename\>.
\⊃ \TEX\ can't find the file you indicated. Type ``{\tt i}'' and insert
the correct file name (followed by a blank space and \<carriage-return\>).
But be careful: You get only
one more chance to get the file name right, otherwise \TEX\ will decide
not to input {\sl any} file just now.
\yskip\noindent{\≡! Missing ≡\}\<something\>{\≡≡ inserted.≡\}
\⊃This message can arise in lots of ways and it can name
a variety of things that \TEX\ sometimes
thinks are missing. For example, if you type $$\hbox{\≡\left(x+{\right)≡\}$$ in
math mode, \TEX\ thinks (correctly) that there's a missing ``{\≡}≡\}''.\xskip (See
Chapter 26.)\xskip
{\sl In general, when you get this message, \TEX\ has already inserted
what it says was missing---don't insert another one.} If \TEX\ has guessed
correctly, just proceed. Otherwise, it may be fun to try getting \TEX\ back into
synch; you might get the message ``{\≡Missing } inserted≡\}'' followed by one that
says ``{\≡Too many }≡'s≡\}'', indicating a certain lack of logic on \TEX's part.
\yskip\noindent{\≡! Missing digit (0 to 9), 0 inserted.≡\}
\⊃ \TEX\ was expecting to see a decimal digit following {\≡\box≡\} or
{\≡\save≡\}, but it isn't there. Proceed; \TEX\ has already inserted a
``{\tt0}''.
\yskip\noindent{\≡! OK.≡\}
\⊃ This isn't an error message. \TEX\ is stopping because you asked it
to ({\≡\ddt≡\} with {\≡\trace≡\} bit \char'16 40 set).
\yskip\noindent{\≡! Only one # allowed per tab.≡\}
\⊃ A \<format\>\ in an alignment preamble must have exactly one {\≡#≡\},
but you seem to have typed more than one. Proceed, and the extra {\≡#≡\}
will be ignored.
\yskip\noindent{\≡! Only single characters can be accented in horizontal mode.≡\}
\⊃ An \<accent\>\ has not been followed by a proper \<accentee\>. Proceed,
and the \<accent\>\ will be ignored.
\yskip\noindent{\≡! \output routine didn't use \page.≡\}
\⊃ A page was assembled for output, but the {\≡\output≡\} routine didn't
make use of it, so it is lost forever. Proceed.
\yskip\noindent{\≡! Parameters must be numbered consecutively.≡\}
\⊃ You must say {\≡#1≡\}, {\≡#2≡\}, etc., in order, when designating
parameters in the \<parameter text\>\ of a macro definition. When you get
this message, \TEX\ has already
inserted the correct parameter number, so you may want to delete an incorrect one
before proceeding.
\yskip\noindent{\≡Overfull box, ...≡\}
\⊃ This is an information message, not an error message (i.e., \TEX\
doesn't stop). The box whose contents are partially displayed is ``overfull''
because it doesn't have enough glue shrinkage to get down to the required size.
Thus the box contents are too wide or too high by the specified amount; in your
output you will probably see this box sticking out somewhere or overlapping another
one, unless the excess is very small. Overfull boxes can arise from a variety
of reasons, notably when there is no decent way to break the lines of certain
paragraphs, or when a displayed equation is too wide to fit on a single line.
You may want to settle for badly broken lines in a paragraph, by increasing the
value of {\≡\jpar≡\} as discussed in Chapter 14; or you might be able to
help by inserting discretionary hyphens, especially if there is a word
that \TEX\ doesn't try to hyphenate (e.g., ``{\≡Inter\-change≡\}'' in the
first line of Appendix F).
But in a high-quality
job an overfull box usually means that the author should rewrite the text,
eliminating the problem entirely.
\yskip\noindent{\≡Runaway argument?≡\}
\⊃This message is followed by the tokens of
a macro argument that didn't end where you wanted it
to.\xskip (See ``{\tt ! Input page ended while scanning use of ...}'' above.)
\yskip\noindent{\≡! TEX capacity exceeded, sorry [≡\}\<size\>{\tt=}\<number\>{\tt].}
\⊃ This is a bad one. Somehow you have stretched \TEX\ beyond its finite
limits. The thing that overflowed is indicated in brackets, together with its
numerical value in the \TEX\ implementation you are using. The following table
shows the internal sizes that might have been exceeded:
$$\vbox{\halign{\tt#\hfill⊗\quad#\hfill\cr
alignsize⊗the number of simultaneous alignments;\cr
fmemsize⊗the number of words of auxiliary font information;\cr
hashsize⊗the number of different multiletter control sequences;\cr
idlevs⊗logarithm of the number of levels of grouping;\cr
memsize⊗memory used to store tokens and many other types of things;\cr
nestsize⊗number of simultaneous partially-complete lists;\cr
parsize⊗number of simultaneous partially-scanned arguments;\cr
savesize⊗number of values to restore at end of group or formula;\cr
stacksize⊗number of simultaneous levels of input;\cr
stringsize⊗number of independent operations on typesetting device;\cr
varsize⊗memory used to store boxes and many other types of things.\cr}}$$
If your job is error-free, the remedy is to recompile the \TEX\ system, increasing
what overflowed. However, there's probably something you can do to your job
that will make it run. Maybe you have specified an infinite macro-expansion;
then it would cause overflow no matter how big you make \TEX. If {\tt savesize} has
overflowed, you probably have started a group and forgot to finish it.\xskip
(Every time
you change fonts, say, inside a group, an entry is being saved, {\sl unless} you
are on level zero.)\xskip Or perhaps you are trying to specify a gigantic alignment
that spans more than a page; \TEX\ has to read all the way to the end of an
alignment before outputting any of it, so this consumes huge amounts of
memory space.\xskip (It's necessary to limit
your alignments to reasonable size, by using a fixed format
for the multipage cases.)\xskip As the message says, it is a sorry situation.
\yskip\noindent{\≡! There's no \halign or \valign going on.≡\}
\⊃ Your input contains a {\≡⊗≡\} or a {\≡\cr≡\} that didn't get
recognized as part of an alignment, perhaps because you didn't mean to type it,
but most likely because some alignment entry doesn't have properly-balanced
grouping. \TEX\ has deleted the offending {\≡⊗≡\} or {\≡\cr≡\}; to recover,
try to insert braces that balance the group, followed by the current token.
For example, if your input was ``{\≡{x⊗≡\}'' up to this point, the ``{\≡{≡\}''
is hiding the ``{\≡⊗≡\}'';
type ``{\tt i}'' and then insert ``{\≡}⊗≡\}''.
\yskip\noindent{\≡! This can't happen.≡\}
\⊃ Something really unexpected has caused \TEX\ to come to a screeching halt.
\yskip\noindent{\≡! This is allowed only in output routines.≡\}
\⊃ The current input token will be ignored, since it specifies an
operation not available except when \TEX\ is running an {\≡\output≡\}
routine (and \TEX\ isn't).
\yskip\noindent{\≡! This dimension shouldn't be negative.≡\}
\⊃ You were naughty and tried to specify a negative \<dimen\>\ where it
isn't allowed. Proceed, and the dimension will be assumed zero.
\yskip\noindent{\≡! Too many }'s.≡\}
\⊃ You are not inside a group, so the ``{\≡}≡\}'' just scanned will
be discarded when you proceed.
\yskip\noindent{\≡! Too much stretch for proper line breaking.≡\}
\⊃ This message usually occurs when you're doing something like
``{\≡\hbox par ≡\}\<dimen\>{\≡{...}≡\}'' and \TEX's line-breaking procedure
is trying to produce a boxed paragraph as described in Chapter 21.
In such cases, ``{\≡\hfill≡\}'' shouldn't be used in the box; \TEX\ will
not break lines in a paragraph when the glue has more than one million points
of accumulated stretchability.\xskip(The reason for this is that the computations
are performed with limited-precision arithmetic, and the spacing will come
out looking bad if \TEX\ tries to make precise measurements after subtracting
infinity from
infinity.)\xskip Proceed, and you'll probably see how bad it looks.
\yskip\noindent{\≡! Undefined control sequence.≡\}
\⊃ \TEX\ has encountered a control sequence it doesn't know; see
Chapters 24, 25, or 26 for hints on how to fix this.
\yskip\noindent{\≡! Unknown delimiter.≡\}
\⊃ The \<delim\>\ you have specified isn't one of those listed in
Chapter 18. Proceed, and \TEX\ will use a blank delimiter.
\yskip\noindent{\≡! Use of ≡\}\<controlseq\>{\≡≡ doesn't match its definition.≡\}
\⊃ You have typed something that doesn't follow the rules of the specified
control sequence.\xskip (For example, consider the control sequence {\≡\ansno≡\}
of Appendix E. If you type ``{\≡\ansno 5.No.≡\}'', you have forgotten the
space that's required after ``{\tt5.}''.)\xskip\TEX\ will proceed by assuming that
the thing you typed was the thing that was required; thus, in the above example,
\TEX\ will assume that the ``{\tt N}'' is a space, and your best strategy is
to insert a new ``{\tt N}''.
\yskip\noindent{\≡! Warning: Long input line has been broken.≡\}
\⊃ Your input file contained a very long sequence of characters between
consecutive \hbox{$\langle$carriage-return$\rangle$}s. \TEX\
arbitrarily broke it after 150 characters.
\yskip\noindent{\≡! Whoa---you have to define a font first.≡\}
\⊃ \TEX\ has aborted your job, because it can't do what you asked it to do
without having some font selected as the ``current font.''
\yskip\noindent{\≡! You can only define a control sequence.≡\}
\⊃ Your manuscript apparently contains {\≡\def≡\} or {\≡\gdef≡\} and the
next thing wasn't a control sequence. Proceed, and \TEX\ forgets that the {\≡\def≡\}
or {\≡\gdef≡\} occurred. For example, if you typed ``{\≡\def ansno≡\}'' when
you meant ``{\≡\def\ansno≡\}'', \TEX\ will read the ``{\tt a}'' and complain;
to recover, you should delete the next four tokens (namely ``{\tt nsno}''),
then insert ``{\≡\def\ansno≡\}''.
\yskip\noindent{\≡! You can't do that in ≡\}\<mode\>.
\⊃ Your manuscript is trying to do something incompatible with
\TEX's current mode. \TEX\ will ignore the token it has just read; so the
proper way to recover is usually to insert something that takes \TEX\ into
the correct mode (e.g., ``{\≡\par≡\}'' will usually
go from horizontal mode to vertical
mode, and ``{\≡$≡\}'' will usually go from math mode to horizontal mode), followed
by the current token again. For example, suppose you have
typed ``{\≡\vskip .5 in≡\}''
before ending a paragraph; \TEX\ will stop before it reads the ``{\tt.5}''.
To recover, type ``{\tt i}'' for insertion, then type ``{\≡\par\vskip≡\}'' and
\<carriage-return\>.
\yskip\noindent{\≡! You can't redefine this control sequence,≡\}
\⊃ You have discovered one of \TEX's reserved control sequences.
The {\≡\def≡\} or {\≡\gdef≡\} will be ignored if you proceed.
\danger \exno 27.1: What is the best way to recover from the following error?
$$\vbox{\halign{#\hfill\cr
{\≡! You can't do that in math mode.≡\}\cr
{\≡\sl →\:≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ n≡\}\cr
{\≡p.3,l.307 $x+y is {\sl≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ not} zero.≡\}\cr}}$$
\danger\exno 27.2: And what about this one?
$$\vbox{\halign{#\hfill\cr
{\≡! Illegal units of measure.≡\}\cr
{\≡<to be read again>≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ p≡\}\cr
{\≡<to be read again> p≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ {≡\}\cr
{\≡(*) \hbox to 50p{Test}≡\}\cr}}$$\enddanger
\danger You can get more information from \TEX\ if you make use of its
{\sl tracing} capability. Type
``{\≡\trace≡'≡\}$mmmnnnxy$'' (using the control sequence {\≡\trace≡\} defined in
Ap\-pendix B) to set up the combination of tracing facilities you want, according
to the following cryptic encoding scheme:
$$\vbox{\halign{\hfill#⊗ #\hfill\cr
$mmm$ is an⊗octal code for the number of items per list that will be shown when a
\cr
⊗\qquad box is displayed.\xskip(If $mmm=0$, it is automatically changed to 5.)\cr
\noalign{\vskip 6pt}
$nnn$ is an⊗octal code for the number of levels deep that will be shown\cr
⊗\qquad when a box is displayed.\cr
\noalign{\vskip 6pt}
$x$ equals⊗(1, if you want to see what replacements are being made\cr
⊗\qquad in macros as they are expanded)\cr
\noalign{\vskip 2pt}
plus⊗(2, if you want each line of your input files to be entered on\cr
⊗\qquad your terminal before it is processed by \TEX, giving you\cr
⊗\qquad a chance to edit it first)\cr
\noalign{\vskip 2pt}
plus⊗(4, if you want \TEX\ to stop whenever the control sequence {\≡\ddt≡\}\cr
⊗\qquad appears in the input).\cr
\noalign{\vskip 6pt}
$y$ equals⊗(1, if you want to be told about ``overfull boxes'')\cr
\noalign{\vskip 2pt}
plus⊗(2, if you want to see the gory details about what is being typeset\cr
⊗\qquad on each page before it is shipped to the {\≡\output≡\} routine)\cr
\noalign{\vskip 2pt}
plus⊗(4, if you want to see \TEX's current activities whenever the\cr
⊗\qquad control sequence {\≡\ddt≡\} appears in the input).\cr
}}$$
The normal setting is {\≡\trace≡'345≡\}. Thus \TEX\ normally shows boxes to
depth 3, with up to 5 items per list; it stops and dumps on {\≡\ddt≡\} calls;
and it shows overfull boxes. If you say ``{\≡\trace0≡\}'' you get
{\sl nothing}, while if you say ``{\≡\trace≡'77777777≡\}'' you probably get
{\sl too much}.
Boxes are displayed when they are overfull, or when they are completed pages,
or when they are in the list of current activities, but only
if the current $x$ or $y$
setting calls for information about
these boxes. The contents will appear on your terminal
as well as on the ``{\tt errors.tmp}'' file; and the format of this information
is self-explanatory, once you understand it. You can, of course, change the
combination of tracing facilities as many times as you want to, so that you
aren't deluged with information when you don't want any.\enddanger
Final hint: When working on a long manuscript, it's best to prepare only a
few pages at a time. Set up a ``galley'' file and a ``book'' file, and enter
your text on the galley file.\xskip(Put control information that sets up your
basic format and fonts at the beginning of this file, so that you don't have to
retype it each time.)\xskip After the galleys come out looking right, you can append
them to the book file; then you can run the book file
through \TEX\ once a week, or so, in order to see how the pages really fit together.
For example, when the author prepared this manual, he did one chapter at a time;
and Chapter 18 was split into three parts, because of its incredible length.
\yyskip\noindent
Final exhortation: G{\:cO FORTH} now and create {\sl
masterpieces of the publishing art!}
\appbegin A. {Answers to all the exercises}
\ninepoint
\def\ansno #1: {\yskip\noindent\hbox to 21.9pt{\hskip0pt plus 1000000pt
minus 1000000pt \bf#1: }}
\ansno 2.1: {\≡≡`≡`$\,$≡`≡\} or {\≡≡`≡`\2≡`≡\} (but {\sl not} {\≡≡`≡`≡`≡\});
{\≡≡`{}≡`≡`≡\} or {\≡{≡`}≡`≡`≡\}, etc.
\ansno 3.1: {\≡math\≡'ematique≡\}, {\≡math\≡'≡ ematique≡\};
{\≡centim\≡`etre≡\}.
\ansno 4.1: {\≡Ulrich Dieter, {\sl Journal f\"ur die reine und angewandte≡break
Mathematik \bf 201} (1959), 37--70.≡\}\xskip (Note in particular the
use of ``{\tt --}'' to get an en-dash, did you remember that?)
\ansno 5.1: Type ``{\≡{-}-≡\}'' or ``{\≡-{-}≡\}'' or ``{\≡{-}{-}≡\}''
or ``{\≡-{}-≡\}'', etc.
\ansno 5.2: No---the first definition is pretty lousy because it accomplishes
nothing!\xskip (When {\≡\rm≡\} appears in the subsequent text it will be replaced
by {\≡{\:a}≡\}, but this font change immediately disappears because it's
inside a group.)
\ansno 5.3: It could end with any character that has been {\≡\chcode≡\}d to 2
at the time the group ends. After that point the effect of all {\≡\chcode≡\}s
inside the group will be lost.
\ansno 6.1: Type ``{\tt i}'' (for insert). Then when \TEX\ prompts you
for more input, type ``{\≡\c c≡\}''; this will be inserted at the current
place in the input (the undefined {\≡\cc≡\} has already been discarded), and
then \TEX\ resumes reading the original line (i.e., it will then read the
comma; you shouldn't insert another comma, since the comma wasn't in error).
\ansno 7.1: Yes, if the format you are using (e.g., {\tt basic}) has defined
{\≡%≡\} to be an end-of-line character (type 5).
\ansno 9.1: {\≡{\sl Commentarii Academ\ae\ Petropolitan\ae} is now {\sl≡break
Doklady Akademi\t\i a Nauk SSSR}.≡\}
\ansno 9.2: {\≡\O ystein Ore≡\},\ \ {\≡\t IUri \t IAnov≡\},\ \
{\≡Ja≡`far al-Khow\A arizm\A\i≡\},\ \ and
{\≡W\l ladyis\l law S\"u\ss man≡\}.
\ansno 10.1: Here is one of many possible solutions.
$$\vbox{\halign{#\hfill\cr
{\≡\def\1{\hbox to 5mm{\hfill\vrule depth 4pt}}≡\}\cr
{\≡\def\2{\hbox to 5mm{\hfill\vrule depth 8pt}}≡\}\cr
{\≡\vbox{\hrule\hbox{\vrule depth 8pt≡\}\cr
{\≡≡ ≡ ≡ ≡ \1\2\1\2\1\2\1\2\1\2\1\2\1\2\1\2\1\2\1\2}}≡\}\cr}}$$
\ansno 12.1: 25, 41, and 12 units, respectively.
\ansno 12.2: ``$\ldots$ {\≡launched by \hbox{NASA}.≡\}''; or ``$\ldots$
{\≡launched by NASA\null.≡\}''
\ansno 16.1:
{\≡$2↑{n+1}$≡\},
{\≡$(n+1)↑2$≡\},
{\≡$\sqrt{1-x↑2}$≡\},
{\≡$\overline{w+\overline z}$≡\},
{\≡$p≡↓1↑{e≡↓1}$≡\},
{\≡$a≡↓{b≡↓{c≡↓{d≡↓e}}}$≡\},
{\≡$h≡↓n↑{\prime\prime}(x)$≡\}.
\ansno 16.2: No space will be typeset after the ``If''.\xskip
(Also, it would have been
slightly better to end with ``{\≡$y$.≡\}''.)
\ansno 16.3: {\≡
Deleting an element from an $n$-tuple leaves an $(n-1)$-tuple.≡\}
\ansno 17.1: {\≡$${p \choose 2}x↑2 y↑{p-2} - {1 \over 1-x}{1 \over 1-x↑2}.$$≡\}
\ansno 17.2: {\≡
$$\sum≡↓{i=1}↑p\sum≡↓{j=1}↑q\sum≡↓{k=1}↑r a≡↓{ij}b≡↓{jk}c≡↓{ki}$$≡\}\quad.
\ansno 17.3: {\≡
$$\sum≡↓{{\scriptstyle1≡≤i≡≤p\atop\scriptstyle1≡≤j≡≤q}\atop≡break
\scriptstyle1≡≤k≡≤r}a≡↓{ij}b≡↓{jk}c≡↓{ki}$$≡\}\quad.
\ansno 18.1: {\≡$n↑{\hbox{\:d th}}$ root≡\}\quad.
\ansno 18.2: {\≡$$\biglp x-s(x)\bigrp\biglp y-s(y)\bigrp.$$≡\}\xskip(Note that the
period is included in this display.)
\ansno 18.3: {\≡
$${1\over2\pi}\int≡↓{-≡∞}↑{\sqrt y}\bigglp\sum≡↓{k=1}↑n≡break
\sin↑2x≡↓k(t)\biggrp\biglp f(t)+g(t)\bigrp\,dt.$$≡\}
\ansno 18.4: {\≡
$${(n≡↓1+n≡↓2+\cdots+n≡↓m)!\over n≡↓1!\,n≡↓2!\ldotsm n≡↓m!}=≡break
{n≡↓1+n≡↓2\choose n≡↓2}{n≡↓1+n≡↓2+n≡↓3\choose n≡↓3}\ldotsm≡break
{n≡↓1+n≡↓2+\cdots+n≡↓m\choose n≡↓m}.$$≡\}
\ansno 18.5: {\≡$\left(\cpile{y≡↓1\cr\vdots\cr y≡↓k\cr}\right)$≡\}\quad.
\ansno 18.6: {\≡
$$\Pscr≡↓{Lhj}(x)=\hbox{Tr}\left[{\partial F≡↓{L↑{-1}}\over≡break
\partial t≡↓h}\chi(L)\Mscr≡↓{nj}(x)\right],\qquad\hbox{evaluated≡break
at }\chi(\Gamma)\modop\hbox{\sl SL}(n,\hbox{\bf C}).$$≡\}
(Here ``{\≡\hbox{\sl SL}≡\}'' gives slightly better spacing than
simply {\tt SL}, because it suppresses the italic correction on the {\sl S}.)
\ansno 18.7: {\≡\def\e{\mathrel{{:}{=}}}≡\}\quad.\xskip(The braces prevent space
between : and =, since they specify one-character subformulas that are converted
into Ord boxes.)\xskip
Another solution is {\≡\def\e{\mathrel{\char≡'72\char≡'75}}≡\}\quad
.
\ansno 20.1: The {\≡##≡\} feature is indispensible when the result text of a
definition contains {\sl other}
definitions.\xskip(We will see later that {\≡##≡\} is also useful for alignments;
cf.\ the definitions of
{\≡\eqalign≡\} and {\≡eqalignno≡\} in Appendix B.)
\ansno 21.1: When a null box was placed on the vertical list below the ``s''
box, the {\≡\lineskip≡\} glue of 3 points was not inserted, because
the {\≡\baselineskip≡\} distance of 0 points was not exceeded. Thus the
interline glue was computed to be 0 points, and the blank line didn't show up.
\ansno 21.2: {\≡
\vbox{\baselineskip-1pt\lineskip 3pt\halign{\ctr{#}\cr≡break
T\cr h\cr i\cr s\cr \cr b\cr o\cr x\cr}}≡\}\quad.
\ansno 21.3: {\≡
\def\boxit#1{\vbox{\hrule\hbox{\vrule\hskip 3pt≡break
\vbox{\vskip 3pt #1 \vskip 3pt}\hskip 3pt\vrule}\hrule}}≡\}\quad.
\ansno 21.4: {\≡
\leaders\chop to 0pt{\hbox to size{\hfill*\lower 3.75pt≡break
\hbox{*}*\lower 3.75pt\hbox{*}*}}\vfill≡\}\quad.
[For more interesting effects, try {\≡\leaders≡\} {\sl inside} of boxes used
as leaders.]
\ansno 22.1: The equation number ``(13)'' would appear on the bottom line
instead of being centered vertically.\xskip(A box constructed by {\≡\vbox≡\}
has the same baseline as the bottom box in the vertical list.)
\ansno 23.1: Since the {\≡\output≡\} routine might occur at an unpredictable
time, the value of {\≡\hsize≡\} may not be 4.5 inches.\xskip(On the other hand,
if it is known that the manuscript
never diddles with {\≡\hsize≡\}, the output routine will be more
readable if {\≡\ctrline≡\} is used for the running title and page number
lines.)
\ansno 23.2: For example, you can replace it by the following:
$$\vbox{\halign{#\hfill\cr
{\≡\output{\vbox to 7.5in{\baselineskip0pt\lineskip0pt≡\}\cr
{\≡≡ ≡ ≡ ≡ \if T\tpage{\vskip.5in}≡\}\cr
{\≡≡ ≡ ≡ ≡ \else{\vbox to.15in{\vfill≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \def\lead{ \leaders\hrule\hfill\ }≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \hbox to 4.5in{\ifeven0{\:b\count0\lead\topmark}≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \else{\:b\topmark\lead\count0}}}≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ \vskip .35in}≡\}\cr
{\≡≡ ≡ ≡ ≡ \page\vfill≡\}\cr
{\≡≡ ≡ ≡ ≡ \if T\tpage{\gdef\tpage{F}≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ \hbox to 4.5in{\hfill\:c\count0\hfill}}≡\}\cr
{\≡≡ ≡ ≡ ≡ \else{}}\advcount0}≡\}\quad.\cr}}$$
\ansno 27.1: (A ``{\≡$≡\}'' was forgotten after the ``{\tt y}''.) If you just
insert a dollar sign now, the ``{\≡{≡\}'' will be unmatched in the math formula,
so \TEX\ will stop again after inserting a ``{\≡}≡\}'' before the ``{\≡$≡\}''
you just inserted; this will cause unbalance and possible embarrassment.
The correct procedure is to insert ``{\≡}${\:≡\}'', then \TEX\ will proceed
almost as if the error hadn't happened.
\ansno 27.2: \TEX\ has already decided that ``{\tt pt}'' was intended but
missing from the input. If you simply proceed now, \TEX\ will insert a ``{\≡{≡\}''
and give you another error message (after which you'll have to delete ``{\≡p≡\}''
and ``{\≡{≡\}''). The correct procedure is to delete the ``{\≡p≡\}'' now
(by typing ``{\tt 1}''); then type $\langle$carriage-return$\rangle$. The
error has been fully corrected (unless picas were meant instead of points).
\appbegin B. {Basic \TEX\ format}
\ninepoint The following listing of file ``{\tt basic.TEX}'' shows how
to give \TEX\ enough knowledge to do the ``basic'' things mentioned in the
main text.
\yyskip
\halign{#\hfill\cr
{\≡\chcode≡'173←1 \chcode≡'176←2 \chcode≡'44←3 \chcode≡'26←4≡\}\cr
{\≡\chcode≡'45←5 \chcode≡'43←6 \chcode≡'136←7 \chcode 1←8≡\}\cr
\noalign{\yskip}
{\≡\def\%{\char≡'45 } % Note, the space after 45 is needed! (e.g.\%0)≡\}\cr
\noalign{\yskip}
{\≡\def\lft#1{#1\hfill}≡\}\cr
{\≡\def\ctr#1{\hfill#1\hfill}≡\}\cr
{\≡\def\rt#1{\hfill#1}≡\}\cr
\noalign{\yskip}
{\≡\def\rjustline#1{\hbox to size{≡\}\cr
{\≡≡ ≡ ≡ ≡ \hskip0pt plus1000cm minus1000cm #1}}≡\}\cr
{\≡\def\ctrline#1{\hbox to size{\hskip0pt plus1000cm minus1000cm≡\}\cr
{\≡≡ ≡ ≡ ≡ #1\hskip0pt plus1000cm minus1000cm}}≡\}\cr
\noalign{\yskip}
{\≡\def\trace{\chpar0←} \def\jpar{\chpar1←} \def\ragged{\chpar8←}≡\}\cr
\noalign{\yskip}
{\≡\def\log{\mathop{\char≡'154\char≡'157\char≡'147}\limitswitch}≡\}\cr
{\≡\def\lg{\mathop{\char≡'154\char≡'147}\limitswitch}≡\}\cr
{\≡\def\ln{\mathop{\char≡'154\char≡'156}\limitswitch}≡\}\cr
{\≡\def\lim{\mathop{\char≡'154\char≡'151\char≡'155}}≡\}\cr
{\≡\def\limsup{\mathop{\char≡'154\char≡'151\char≡'155≡\}\cr
{\≡≡ ≡ ≡ ≡ \,\char≡'163\char≡'165\char≡'160}}≡\}\cr
{\≡\def\liminf{\mathop{\char≡'154\char≡'151\char≡'155≡\}\cr
{\≡≡ ≡ ≡ ≡ \,\char≡'151\char≡'156\char≡'146}}≡\}\cr
{\≡\def\sin{\mathop{\char≡'163\char≡'151\char≡'156}\limitswitch}≡\}\cr
{\≡\def\cos{\mathop{\char≡'143\char≡'157\char≡'163}\limitswitch}≡\}\cr
{\≡\def\tan{\mathop{\char≡'164\char≡'141\char≡'156}\limitswitch}≡\}\cr
{\≡\def\cot{\mathop{\char≡'143\char≡'157\char≡'164}\limitswitch}≡\}\cr
{\≡\def\sec{\mathop{\char≡'163\char≡'145\char≡'143}\limitswitch}≡\}\cr
{\≡\def\csc{\mathop{\char≡'143\char≡'163\char≡'143}\limitswitch}≡\}\cr
{\≡\def\max{\mathop{\char≡'155\char≡'141\char≡'170}}≡\}\cr
{\≡\def\min{\mathop{\char≡'155\char≡'151\char≡'156}}≡\}\cr
{\≡\def\sup{\mathop{\char≡'163\char≡'165\char≡'160}}≡\}\cr
{\≡\def\inf{\mathop{\char≡'151\char≡'156\char≡'146}}≡\}\cr
{\≡\def\det{\mathop{\char≡'144\char≡'145\char≡'164}}≡\}\cr
{\≡\def\exp{\mathop{\char≡'145\char≡'170\char≡'160}\limitswitch}≡\}\cr
{\≡\def\Pr{\mathop{\char≡'120\char≡'162}}≡\}\cr
{\≡\def\gcd{\mathop{\char≡'147\char≡'143\char≡'144}}≡\}\cr
{\≡\def\choose{\comb()}≡\}\cr
{\≡\def\leftset{\mathopen{\{\,}}≡\}\cr
{\≡\def\rightset{\mathclose{\,\}}}≡\}\cr
{\≡\def\modop{\<\,\mathbin{\char≡'155\char≡'157\char≡'144}\penalty900\<\,}≡\}\cr
{\≡\def\mod#1{\penalty0\;(\char≡'155\char≡'157\char≡'144\,\,#1)}≡\}\cr
{\≡\def\eqv{\mathrel\char≡'421 }≡\}\cr
{\≡\def\neqv{\mathrel{\not\eqv}}≡\}\cr
\noalign{\yskip}
{\≡\def\qquad{\quad\quad}≡\}\cr
\noalign{\yskip}
{\≡\def\ldots{{.\≡≥.\≡≥.}}≡\}\cr
{\≡\def\cdots{{\char≡'401\≡≥\char≡'401\≡≥\char≡'401}}≡\}\cr
{\≡\def\ldotss{{.\≡≥.\≡≥.\≡≥}}≡\}\cr
{\≡\def\cdotss{\cdots\≡≥}≡\}\cr
{\≡\def\ldotsm{{\≡≥.\≡≥.\≡≥.\≡≥}}≡\}\cr
{\≡\def\vdots{\vbox{\baselineskip 4pt\vskip 6pt≡\}\cr
{\≡≡ ≡ ≡ ≡ \hbox{.}\hbox{.}\hbox{.}}}≡\}\cr
\noalign{\yskip}
{\≡\def\eqalign#1{\vcenter{\halign{\hfill$\dispstyle{##}$\!≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ⊗$\dispstyle{\null##}$\hfill\cr#1}}}≡\}\cr
{\≡\def\eqalignno#1{\vbox{\tabskip0pt plus1000pt minus1000pt≡\}\cr
{\≡≡ ≡ ≡ ≡ \halign to size{\hfill$\dispstyle{##}$\tabskip 0pt≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ⊗$\dispstyle{\null##}$\hfill≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ \tabskip0pt plus1000pt minus1000pt≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ⊗$\hfill##$\tabskip 0pt\cr#1}}}≡\}\cr
{\≡\def\cpile#1{\vcenter{\halign{$\hfill##\hfill$\cr#1}}}≡\}\cr
{\≡\def\lpile#1{\vcenter{\halign{$##\hfill$\cr#1}}}≡\}\cr
{\≡\def\rpile#1{\vcenter{\halign{$\hfill##$\cr#1}}}≡\}\cr
{\≡\def\null{\hbox{}}≡\}\cr
{\≡\def\twoline#1#2#3{\halign{\hbox to size{##}\cr$\quad\dispstyle≡\}\cr
{\≡≡ ≡ ≡ ≡ {#1}$\hfill\cr\noalign{\penalty1000\vskip#2}≡\}\cr
{\≡≡ ≡ ≡ ≡ \hfill$\dispstyle{#3}\quad$\cr}}≡\}\cr
\noalign{\yskip}
{\≡\def\chop to#1pt#2{\hbox{\lower#1pt\null\vbox{\hbox{\lower99pt≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ \hbox{\raise99pt\hbox{$\dispstyle{#2}$}}}\vskip-99pt}}}≡\}\cr
{\≡\def\spose#1{\hbox to 0pt{#1\hskip0pt minus10000000pt}}≡\}\cr
\noalign{\yyskip}
{\≡\:@←cmathx≡\}\cr
{\≡\:a←cmr10 \:d←cmr7 \:f←cmr5≡\}\cr
{\≡\:g←cmi10 \:j←cmi7 \:l←cmi5≡\}\cr
{\≡\:n←cms10≡\}\cr
{\≡\:q←cmb10≡\}\cr
{\≡\:u←cmsy10 \:x←cmsy7 \:z←cmsy5≡\}\cr
{\≡\:?←cmti10≡\}\cr
\noalign{\yskip}
{\≡\def\rm{\:a} \def\sl{\:n} \def\bf{\:q} \def\it{\:?}≡\}\cr
\noalign{\yskip}
{\≡\parindent 20pt \maxdepth 2pt \topbaseline 10pt≡\}\cr
{\≡\parskip 0pt plus 1 pt \baselineskip 12pt \lineskip 1pt≡\}\cr
{\≡\dispskip 12pt plus 3pt minus 9pt≡\}\cr
{\≡\dispaskip 0pt plus 3pt \dispbskip 7pt plus 3pt minus 4pt≡\}\cr
\noalign{\yskip}
{\≡\def\biglp{\mathopen{\vcenter{\hbox{\:@\char≡'0}}}}≡\}\cr
{\≡\def\bigrp{\mathclose{\vcenter{\hbox{\:@\char≡'1}}}}≡\}\cr
{\≡\def\bigglp{\mathopen{\vcenter{\hbox{\:@\char≡'22}}}}≡\}\cr
{\≡\def\biggrp{\mathclose{\vcenter{\hbox{\:@\char≡'23}}}}≡\}\cr
{\≡\def\biggglp{\mathopen{\vcenter{\hbox{\:@\char≡'40}}}}≡\}\cr
{\≡\def\bigggrp{\mathclose{\vcenter{\hbox{\:@\char≡'41}}}}≡\}\cr
\noalign{\yskip}
{\≡\mathrm adf \mathit gjl \mathsy uxz \mathex @≡\}\cr
\noalign{\yskip}
{\≡\output{\baselineskip20pt\page\ctrline{\:a\count0}\advcount0}≡\}\cr
{\≡\setcount0 1≡\}\cr
\noalign{\yskip}
{\≡\rm≡\}\cr
{\≡\null\vskip-12pt % allow glue at top of first page≡\}\cr}
\vfill
\specialappbegin E. {Example of a book format}
\ninepoint
This appendix contains two parts: First comes a supplement to the \TEX\ report,
explaining the main conventions a typist uses when entering material from
{\sl The Art of Computer Programming} ({\sl ACP\/}) into the system. Second
is a listing of file {\tt acphdr.TEX}, in which the precise format for those
books is defined in terms of \TEX\ control sequences.
As you read the first part of this appendix, try to imagine that you yourself are
a typist with the responsibility for inputting part of the manuscript for this
series of books.
Several examples below are best understood if you have a copy of {\sl ACP} handy;
so why not go fetch your copy of Volume 1 now?\xskip
(And if you have Volume 2, that will help even more.)
\def\b{\yskip\textindent{$\bullet$}}
\b Since this appendix must cover a wide range of topics in a reasonably short
space, it is rather terse; please forgive the author for this. Every time you
see ``$\bullet$'' in this appendix, you're being hit with a new topic.
\b Everything in Appendix B---the ``basic'' format that is explained throughout
the user manual---is used also in {\sl ACP}, except that the conventions for
number theory are slightly different.\xskip(See Chapter 18, part 8, for a
discussion of Appendix B's approach to number theory.)\xskip To typeset ``$x≡0\;
(\hbox{modulo}\,\,
pq)$'', type ``{\≡$x \eqv 0 \modulo{pq}$≡\}''; and to typeset the operator
``mod'' you can use {\≡\mod≡\} instead of {\≡\modop≡\}. There also
is one further control sequence defined for mathematics, namely {\≡\deg≡\} for
the degree symbol: type ``{\≡$45\deg$≡\}'' to get ``$45↑{\hbox{\hskip-1pt\:w
\char5}}$''.
\def\<{$\langle$}\def\>{$\rangle$}
\b The style of typical bibliographic references is ``\<author name\>{\≡,≡char'40
{\sl≡\}\<name of book or journal\>{\≡≡char'40\bf≡\}\<volume number\>{\≡}≡char'40
(≡\}\<year\>{\≡),≡char'40≡\}\<starting page\>{\tt--}\<ending page\>{\tt.}''
For example,$$\vbox{\halign{#\hfill\cr
{\≡M. R. Garey et.\ al., {\sl SIAM J. Appl.\≡\}\cr
{\≡≡ ≡ Math.\ \bf34} (1978), 477--495.≡\}\cr}}$$
Another example appears in the answer to exercise 4.1 (see Appendix A).
\b Remember to type ``{\≡\≡\}'' after any abbreviation in which a lower case
letter is followed by a period followed by a space, when this period is not
the end of a sentence. Abbreviations aren't used very much in {\sl ACP}, but they
do occur frequently in bibliographic references (as in the example just
given). Furthermore you should be on the lookout for the following commonly-used
abbreviations:
$$\hbox{\≡Eq.\≡qquad Eqs.\≡qquad Fig.\≡qquad Figs.\≡qquad cf.\≡qquad ed.\≡qquad
etc.\≡\}$$
The special abbreviations ``{\:m A.D.}'' and ``{\:m B.C.}'', sometimes used in
dates, are typed ``{\≡{\:m A.D.}≡\}'' and ``{\≡{\:m B.C.}≡\}'', respectively,
in order to get them into the small caps font.
\b Remember to type en-dashes, not only when giving page numbers in bibliographic
references but also in constructions like the following:
$$\hbox{\≡exercise 3.1--6≡qquad Table 3.2.1.1--1≡qquad Fig.\ A--1≡\}$$
\b Each major section of {\sl ACP} starts on a new page.\xskip (A
$\underline{\hbox{ma}}$j\hskip-1pt$\underline{\hbox{\hskip 1pt or section}}$ is a
section whose number contains just one decimal point, for example ``Section
3.2''.)\xskip A separate computer file is maintained for each major section;
for example, file {\tt v232.TEX} contains Volume 2, Section 3.2. Such a file
starts out with the following fixed information:
$$\vbox{\halign{#\hfill\cr
{\≡\input acphdr≡\}\cr
{\≡\runninglefthead{≡\}\<chapter title with all letters capitalized\>{\≡}≡\}\cr
{\≡\titlepage\tenpoint≡\}\cr
{\≡\vfill≡\}\cr
{\≡\ctrline{SECTION ≡\}\<major section number\>{\≡≡ OF≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ THE ART OF COMPUTER
PROGRAMMING}≡\}\cr
{\≡\ctrline{$\copyright$ ≡\}\<year\>\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ Addison--Wesley
Publishing Company, Inc.}≡\}\cr
{\≡\vfill≡\}\cr
{\≡\runningrighthead{≡\}\<section title with all letters capitalized\>{\≡}≡\}\cr
{\≡\section{≡\}\<major section number\>{\≡}≡\}\cr
{\≡\eject\setcount0 ≡\}\<starting page number\>\cr
{\≡\sectionbegin{≡\}\<major section number\>{\≡.≡char'40≡\}\<section title with
all letters capitalized\>{\≡}≡\}\cr}}$$
For example, the last four lines of this introductory information have the
following form on file {\≡v232.TEX≡\}:
$$\vbox{\halign{#\hfill\cr
{\≡\runningrighthead{GENERATING UNIFORM RANDOM NUMBERS}≡\}\cr
{\≡\section{3.2}≡\}\cr
{\≡\eject\setcount0 9≡\}\cr
{\≡\sectionbegin{3.2. GENERATING UNIFORM RANDOM NUMBERS}≡\}\cr}}$$
The beginning of a major section is a major event in {\sl ACP}, so you are
asked to type all of the above---no special control sequence has been made for
it.\footnote*{The beginning of a chapter is an even more major event; the format for
such a gala occasion won't be described here, since the author will do the
first page of each chapter by himself, just to keep his hand in.}
One further piece of fanciness is used at the beginning of a major section:
The first words of the opening sentence are typeset with capital letters
from font {\≡\:c≡\} in place of lower case letters.
For example, the four lines that we have quoted from {\tt v232.TEX} are
immediately followed in that file by
$$\hbox{\≡I{\:cN THIS SECTION} we shall consider methods≡\}$$
(and the result when typeset looks like this: ``$\,${\:aI{\:cN THIS SECTION}
we shall consider methods}'').
\b A $\underline{\hbox{minor section}}$
of {\sl ACP} is one whose number contains two decimal
points, for example ``Section 4.2.2''. Each minor section starts out with
four special lines
$$\vbox{\halign{#\hfill\cr
{\≡\runningrighthead{≡\}\<section title with all letters capitalized\>{\≡}≡\}\cr
{\≡\section{≡\}\<minor section number\>{\≡}≡\}\cr
{\≡\sectionskip≡\}\cr
{\≡\sectionbegin{≡\}\<minor section number\>{\tt.\char'40}$\,$\<section title
partially capitalized\>{\≡}≡\}\cr}}$$
followed by the text of the first paragraph. ``Partially capitalized'' means that
you capitalize only major words, as in the title of a book. For example:
$$\vbox{\halign{#\hfill\cr
{\≡\runningrighthead{ACCURACY OF FLOATING-POINT ARITHMETIC}≡\}\cr
{\≡\section{4.2.2}≡\}\cr
{\≡\sectionskip≡\}\cr
{\≡\sectionbegin{4.2.2. Accuracy of Floating-Point Arithmetic}≡\}\cr
{\≡Floating-point computation is by nature inexact, and ...≡\}\cr}}$$
Thus, a minor section has much less fanfare, and there is no messing around
with font {\≡\:c≡\}.
\b A $\underline{\hbox{diminished section}}$
of {\sl ACP} is one whose number contains three decimal
points, for example ``Section 1.2.11.1''. This is typed just the same as a
minor section, except that you omit the {\≡\sectionskip≡\}, you use
{\≡\dimsectionbegin≡\} instead of {\≡\sectionbegin≡\}, and you capitalize only
the first word of the section title. For example:
$$\vbox{\halign{#\hfill\cr
{\≡\runningrighthead{THE O-NOTATION}≡\}\cr
{\≡\section{1.2.11.1}≡\}\cr
{\≡\dimsectionbegin{\star 1.2.11.1. The $O$-notation}≡\}\cr
{\≡A very convenient notation for dealing with ...≡\}\cr}}$$
This example illustrates another thing: you type ``{\≡\star≡\}'' just after
``{\≡sectionbegin{≡\}'' when beginning a ``starred'' section or subsection.\xskip
(\TEX\ will then insert an asterisk in the left margin.)\xskip
Such stars occur sometimes even in major sections.
\b A $\underline{\hbox{subsection}}$
of {\sl ACP} ranks lowest in the hierarchy. It is part of
a section that is introduced by a bold-face subhead, but this subhead never
gets into the running headline at the top of right-hand pages. You specify
the beginning of a subsection simply by typing
$$\hbox{{\≡\subsectionbegin{≡\}\<subhead\>{\≡}≡\}}$$
followed by the opening paragraph of the subsection. Don't type a period
after the subhead---\TEX\ will typeset one anyway, it's part of the
subsection format---and if you include another period there will be two! This is
consistent with the titles of sections in general (see the examples above);
you never put a period before the {\≡}≡\}.
Here are two examples of subsection format, taken from within sections 1.3.3
and 3.3.2 of {\sl ACP\/}:
$$\vbox{\halign{#\hfill\cr
{\≡\subsectionbegin{Products of permutations}≡\}\cr
{\≡We can ≡`≡`multiply≡'≡'≡ two permutations together, ...≡\}\cr
\noalign{\vskip 3pt}
{\≡\subsectionbegin{E. Coupon collector's test}≡\}\cr
{\≡This test is related to the poker test ...≡\}\cr}}$$
\b Special events like theorems and algorithms sometimes occur in the text of
a section, and they have their own special format. Type
$$\hbox{{\≡\algbegin ≡\}\<name of algorithm or program\>{\tt\char'40(}\<
descriptive title\>\tt).\char'40}$$
at the beginning of an algorithm or program. For example (taken from pages 2 and
141 of Volume 1):
$$\vbox{\halign{#\hfill\cr
{\≡\algbegin Algorithm E (Euclid's algorithm). Given two ...≡\}\cr
\noalign{\vskip 3pt}
{\≡\algbegin Program M (Find the maximum). Register assignments: ...≡\}\cr}}$$
Similarly, you type
$$\hbox{{\≡\thbegin ≡\}\<name of theorem or lemma or corollary\>\tt.\char'40}$$
at the beginning of a theorem or lemma or corollary. The text of a theorem or
lemma or corollary is set in {\sl slanted} type, with any embedded math
formulas set off by {\≡$≡\}'s as usual (so that italic letters will be
distinguishable from slanted ones). For example,
$$\vbox{\halign{#\hfill\cr
{\≡\thbegin Corollary P. {\sl If a $[0,1)$ sequence is≡\}\cr
{\≡$k$-distributed, it satisfies the permutation test of≡\}\cr
{\≡order $k$, in the sense of Eq.\ $(10)$.}≡\}\cr}}$$
Be sure to remember the final {\≡}≡\} that turns off the {\≡\sl≡\}, otherwise
you'll see a lot of slantedness in the following text.
\b When beginning the proof of a theorem, type ``{\≡\proofbegin≡\}'' (with
no period following it) instead of ``{\sl Proof.}''. For example,
$$\hbox{\≡\proofbegin It is clear that ...≡\}\quad.$$
(But use {\≡\dproofbegin≡\} if the preceding paragraph ended with a display.)\xskip
At the {\sl end} of the last paragraph of a proof, type the following ritual:
$$\vbox{\halign{#\hfill\cr
{\≡\quad\blackslug≡\}\cr
\<empty line to end the paragraph\>\cr
{\≡\yyskip≡\}\cr}}$$
This typesets a ``\hbox{\hskip 1pt\vrule width4pt height6pt depth1.5pt\hskip1pt}''
and leaves extra space before the paragraph that follows.
The same ritual is used also at the end of the last step of an algorithm.
\b Speaking of the steps of algorithms, each step is a separate paragraph.
At the beginning of that paragraph the instructions
$$\hbox{{\≡\algstep ≡\}\<step number\>{\tt.\char'40[}\<description of step\>\tt]}$$
should be typed. For example, the following comes from page 2 of Volume 1:
$$\halign{\hskip 20pt#\hfill\cr
{\≡\algstep E1. [Find remainder.] Divide $m$ by $n$ and let $r$≡\}\cr
{\≡be the remainder.\xskip (We will have $0≡≤r<n$.)≡\}\cr
\noalign{\vskip 11pt}
{\≡\algstep E2. [Is it zero?] If $r=0$, the algorithm≡\}\cr
{\≡terminates; $n$ is the answer.≡\}\cr
\noalign{\vskip 11pt}
{\≡\algstep E3. [Interchange.] Set $m←n$, $n←r$, and go back≡\}\cr
{\≡to step E1.\quad\blackslug≡\}\cr
\noalign{\vskip 11pt}
{\≡\yyskip Of course, Euclid did not present his algorithm in≡\}\cr
{\≡just this manner. The above format illustrates the style≡\}\cr
{\≡in which all of the algorithms throughout this book will≡\}\cr
{\≡be presented.≡\}\cr}$$
\b Within a paragraph, type ``{\≡\xskip≡\}'' before and after parenthesized
sentences.\xskip(For example, there is an {\≡\xskip≡\} in the paragraph you're
now reading, and in algstep E1 above.)
\b Sometimes the author wants to insert extra space between paragraphs of
a section, in order to indicate a slight change of topic. For this you
type ``{\≡\yskip≡\}'' just before the new paragraph.\xskip (The space corresponding
to {\≡\yskip≡\} turns out to be just half the space corresponding to
{\≡\yyskip≡\}.)
Another use of {\≡\yskip≡\} sometimes occurs when paragraphs appear in series, with
``a)'' inserted in place of the indentation in the first paragraph, ``b)''
in the next, and so on. For this you type ``{\≡\yskip\textindent{a)}≡\}''.
Also add the control sequence ``{\≡\hang≡\}'' if the entire paragraph
(except for the ``a)'') is to be indented. For example, the paragraph you
are about to read next has been typeset with the instructions
$$\hbox{\≡\yskip\textindent{$\bullet$}Sections normally end ...≡\}$$
\b Sections normally end with a group of exercises. At this point you type
$$\hbox{\≡\exbegin{EXERCISES}≡\}$$
or (in some cases) ``{\≡\exbegin{EXERCISES---First Set}≡\}'', etc. Then come
the exercises, one by one, each starting a new paragraph. At the beginning
of this paragraph you type
$$\vbox{\halign{\hfill#\qquad⊗# \<number\>{\tt.\char'40[}\<rating\>\tt]\hfill\cr
either⊗{\≡\exno≡\}\cr or⊗{\≡\trexno≡\}\cr}}$$
where {\≡\trexno≡\} is used if the exercise is supposed to have a triangle
in the margin. For example,
$$\vbox{\halign{#\hfill\cr
{\≡\exno 4. [M50] Prove that when $n$ is an integer, $n>2$, the≡\}\cr
{\≡equation $x↑n+y↑n=z↑n$ has no solution in positive integers≡\}\cr
{\≡$x$, $y$, $z$.≡\}\cr}}$$
After the ``{\tt[}\<rating\>{\tt]}'' of an exercise there sometimes is
a parenthesized descriptive title, or the name of the originator of the
exercise. The descriptive title, if present, should be slanted; names should not.
The closing right parenthesis should be preceded by a period and followed
immediately by ``{\≡\xskip≡\}'' without any intervening space.
For example (see {\sl ACP} Volume 1, page 20):
$$\vbox{\halign{#\hfill\cr
{\≡\exno 14. [50] (R. W. Floyd.)\xskip Prepare a computer program ...≡\}\cr
\noalign{\vskip 3pt}
{\≡\trexno 15. [HM28] ({\sl Generalized induction.})\xskip The ...≡\}\cr}}$$
If the exercise contains subparts (a), (b), etc., there are two cases: The
subparts may be introduced by {\≡\textindent≡\}s (as in the exercise 15 we
were just looking at on page 20 of Volume 1), or they may be embedded in
a paragraph (as in exercise 29 on page 26).
The first case should be treated by making separate paragraphs introduced by
``{\≡\hang\textindent{a)}≡\}''; put {\≡\yskip≡\} before the first such
paragraph, but not before the others. In the
second case, type ``{\≡\xskip (a)≡\}'' and ``{\≡\xskip (b)≡\}'', etc., where there
is no space before the {\≡\xskip≡\}.
If the exercise contains a ``hint'' within a paragraph,
you type ``{\≡\xskip[{\sl Hint:}≡char'40
≡\}$\,$''; as usual, there should be no space before {\≡\xskip≡\}.
\b Answers to the exercises appear at the back of the book; they are entered
on a separate file---e.g., {\tt v2ans.TEX} for the answers of Volume 2.
It is best to typeset the answers for each individual section
at the same time as you typeset the exercises for that section, in order to
ensure consistency. In the answer pages you say
$$\hbox{{\≡\ansbegin{≡\}\<section number\>{\≡}≡\}}$$
just before the answers to the exercises for a particular section. Then each
answer is preceded by
$$\hbox{{\≡\ansno ≡\}\<number\>\tt.\char'40}$$
For example (reading from Volume 1, page 465),
$$\vbox{\halign{#\hfill\cr
{\≡\ansbegin{1.1}≡\}\cr
\noalign{\vskip 6pt}
{\≡\ansno 1. $t←a$, $a←b$, $b←c$, $c←d$, $d←t$.≡\}\cr
\noalign{\vskip 6pt}
{\≡\ansno 2. After the first time, ...≡\}\cr}}$$
Now look at answer number 3 on that page of Volume 1; here you should {\sl not}
use ``{\≡\algbegin≡\}'', since {\≡\algbegin≡\} is for algorithms in the text.
By looking at the formal definition of {\≡\algbegin≡\} in the later part of
this appendix, you can see how to modify it in order to handle this particular
case, namely to type
$$\vbox{\halign{#\hfill\cr
{\≡\ansno 3. {\bf Algorithm F }({\sl Euclid's≡\}\cr
{\≡algorithm\/}){\bf.}\xskip Given two positive ...≡\}\cr}}$$
In still more complicated cases you may have to typeset the exercise number
yourself in connection with {\≡\halign≡\}. Then you use {\≡\anskip≡\} just
before the answer, in order to get the proper spacing between answers.
Sometimes one answer is given for two or more exercises. In this case you
use ``{\≡\ansnos≡\}'' instead of ``{\≡\ansno≡\}''. For example (please turn
to page 599 of Volume 1),
$$\hbox{\≡\ansnos 15, 16. $\rI1\eqv\.{P0}$, $\rI2\eqv\.{P1}, ...≡\}$$
\b This last example leads to the question of {\tt MIX} programs, which make
you work a bit harder. The word ``{\tt MIX}'' should always be handled by
typing the control sequence {\≡\MIX≡\}. This will set it in {\tt typewriter
type}, namely the fixed-width font used also for examples in this
manual.\xskip (Remember to type ``{\≡\MIX\≡\}'' when a blank space follows; it's
the same problem as using the {\≡\TEX≡\} logo, see Chapter 3.)
When you want to typeset something else in typewriter type, use the abbreviation
{\≡\tt≡\}; for example, {\≡\MIX≡\} is short for ``{\≡{\tt MIX}≡\}''. Or if
typewriter type is being used in a math formula, you use the control sequence
``{\≡\.≡\}'', which comes in very handy. For example, ``{\≡\.{P0}≡\}'' in the
excerpt from page 599 above yields the ``{\tt P0}'' of the formula ``$\hbox{rI1}
\eqv\hbox{\tt P0}$''. Another thing to keep in mind when doing formulas
related to {\tt MIX} is the fact that ``rA'', ``rX'', ``rAX'', ``rI'', and
``rJ'' are supposed to be in roman type, not italics; so you use the control
sequences {\≡\rA≡\}, {\≡\rX≡\}, {\≡\rAX≡\}, {\≡\rI≡\}, {\≡\rJ≡\}.\xskip (The example
above shows a typical use of ``{\≡\rI≡\}''.)
\b For {\tt MIX} programs themselves, further control sequences come into
play. For example, let's continue with the example from page 599 of Volume 1:
$$\vbox{\halign{#\hfill\cr
{\≡{\yyskip\tabskip 25pt \mixthree{\!≡\}\cr
{\≡D1⊗LD1⊗P0⊗\understep{D1.}\cr≡\}\cr
{\≡⊗LD2⊗0,1(SIZE)\cr≡\}\cr
{\≡⊗ENN6⊗0,2⊗$\.N←\.{SIZE(P0)}.$\cr≡\}\cr
{\≡⊗INC2⊗0,1⊗$\.{P1}←\.{P0}+\.N$\cr≡\}\cr
{\≡⊗LD5⊗0,2(TSIZE)\cr≡\}\cr
{\≡⊗J5N⊗D4⊗To D4 if $\.{TAG(P1)}=\hbox{≡`≡`$-$≡'≡'}$.\cr≡\}\cr
{\≡\\D2⊗LD5⊗-1,1(TSIZE)⊗\understep{D2.}\cr≡\}\cr
\noalign{\vskip 11pt plus 3pt minus 8pt
\hbox{and so on, ending (on page 600) with}
\vskip 11pt plus 3pt minus 8pt}
{\≡⊗ST6⊗-1,2(TSIZE)⊗$\.{SIZE(P1-1)}←\.N$,≡\}\cr
{\≡≡ ≡ $\.{TAG(P1-1)}←\hbox{≡`≡`$-$≡'≡'}$.\quad\blackslug\cr}}≡\}\cr}}$$
Explanation:\xskip(i) ``{\≡\tabskip 25pt≡\}'' causes each line of the program
to be indented 25 points. [For short programs, you can start with ``{\≡$$\vbox{≡!
\mixthree{\!≡\}'' and end with ``{\≡\cr}}$$≡\}'',
if you want the program to be centered. But that would be a bad idea
on such a long program, because it would disallow breaks between pages.]
(ii) ``{\≡\mixthree{\!≡\}'' is the way you begin {\tt MIX} program format that
has three columns of special code before the right-hand column; the right-hand
column is
typeset normally. Sometimes there are {\sl four} special columns, as in the
program on page 568; in this case the first column contains numbers in italics. The
rule is to use {\≡\mixfour≡\} when there are four such columns. The first line
on page 568, for example, would be typed
$$\hbox{\≡68⊗8H⊗CON⊗0⊗Zero constant for initialization\cr≡\}$$
provided that you are looking at the second edition of Volume 1---the
first edition has a different line there, namely
$$\hbox{\≡65⊗⊗JMP⊗1F⊗\quad$\.{RLINK(U)}=\Lambda$.\cr≡\}\quad.$$
Sometimes, in fact, there are {\sl five} special columns, as in the program on page
601; the fifth column contains centered math formulas, and
for this you use {\≡\mixfive≡\}.\xskip (Incidentally, when a program turns out to
be too wide for the normal page size, as this one does,
it is typeset separately and reduced by
the publisher's cameras.)\xskip At the other extreme, there sometimes
are {\tt MIX} programs with only two special
columns; for example, to get the programs displayed at the bottom of page 242,
you type
$$\vbox{\halign{#\hfill\cr
{\≡$$\vcenter{\mixtwo{LD1⊗I\cr LDA⊗L$≡↓0$,1\cr}}≡\}\cr
{\≡\qquad\hbox{to, e.g.,}\qquad≡\}\cr
{\≡\vcenter{\mixtwo{LD1⊗I\cr LDA⊗BASE(0:2)\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ STA⊗*+1(0:2)\cr LDA⊗*,1\cr}}\eqno(8)$$≡\}\quad.\cr}}$$
(iii) When you type ``{\≡\\≡\}'' at the beginning of a line of a {\tt MIX} program,
using either {\≡\mixtwo≡\} or {\≡\mixthree≡\} or {\≡\mixfour≡\} or {\≡\mixfive≡\},
it signifies a desirable place to break the page if \TEX\ needs to make a
break. The author will tell you where to put these.
(iv) ``{\≡\understep≡\}'' will underline a step description. This works
nicely when the step doesn't involve any letters or symbols that go below the
line; but otherwise you need to break the underline by brute force, discontinuing
it so that it doesn't touch letters with descenders. For example, here is the
proper way to type line 22 of the program on page 601 of Volume 1 (using
{\≡\mixfive≡\} format):
$$\vbox{\halign{#\hfill\cr
{\≡22⊗R3⊗J3Z⊗DONE⊗1⊗\understep{R3. S}{\sl p\hskip-3pt}\!≡\}\cr
{\≡\understep{\hskip3pt lit re\hskip 2.5pt}{\sl\hskip-2.5pt q}\!≡\}\cr
{\≡\understep{uired?}\cr≡\}\cr}}$$
The {\≡\hskip≡\}ping brings the underlines partway under the
{\sl p} and {\sl q}, making it look as if we have a special font with underlined
symbols. This is messy in the manuscript, but it looks nice in the output; you get
$$\def\understep#1{$\underline{\hbox{\sl#1}}$}
\hbox{{\it22}\quad{\tt R3\ \ }\quad{\tt J3Z }\quad{\tt DONE\ \ \
}\qquad1\qquad\understep{R3. S}{\sl p\hskip-3pt}\!
\understep{\hskip3pt lit re\hskip 2.5pt}{\sl\hskip-2.5pt q}\!
\understep{uired?}}$$
(See also the examples
in Chapter 18 of this manual---the boldface subheads were made with such
underlining. The underlines actually drawn on page 601 of the second edition
of Volume 1 are too low; the third edition---typeset by \TEX---will look
much better!)
To sum up the last few paragraphs, we can say that {\tt MIX} programs are
indeed troublesome to typeset; but by using the control sequences {\≡\mixtwo≡\},
$\ldotss$, {\≡\mixfive≡\} you can avoid almost all of the difficulty of changing
in and out of typewriter type and lining up the columns. Incidentally, there
is also another control sequence {\≡\mixans≡\} that you can use for answers
like number 2 on pages 523 and 524. Instead of beginning that answer with
``{\≡\ansno 2.≡\}'', you type
$$\vbox{\halign{#\hfill\cr
{\≡\mixans 2. {⊗SHIFT⊗J5N⊗ADDRERROR\cr≡\}\cr
{\≡⊗⊗DEC3⊗5\cr≡\}\cr
\noalign{\vskip-3pt}
\qquad\vdots\cr
{\≡⊗1H⊗SRC⊗1⊗\quad\blackslug\cr}≡\}\cr}}$$
This works something like {\≡\mixthree≡\}, but each line
begins with an additional {\≡⊗≡\}.
\b For quotations you type
$$\vbox{\halign{#\hfill⊗#\hfill\cr
{\≡\quoteformat{≡\}⊗\<first line\>{\≡\cr≡\}\cr
⊗\<second line\>{\≡\cr≡\}\cr
\noalign{\vskip-3pt}
⊗\qquad\vdots\cr
⊗\<last line\>{\≡\cr≡\}\cr
\noalign{\hbox{{\≡\author{≡\}\<author information\>{\≡}≡\}}}}}$$
For example, the quotation at the end of Chapter 2 (Volume 1, page 463)
should be done this way (including a few small changes that will be made
in the third edition):
$$\vbox{\halign{#\hfill\cr
{\≡\quoteformat{You will, I am sure, agree with me...that if page\cr≡\}\cr
{\≡534 finds us only in the second chapter,\cr≡\}\cr
{\≡the length of the first one must have been really intolerable.\cr}≡\}\cr
{\≡\author{SHERLOCK HOLMES, in {\sl The Valley of Fear} (1888)}≡\}\cr}}$$
Sans-serif 8-point fonts will automatically be used for quotations typed
in this way. The quotation itself is automatically set in a slanted font,
while the author information is automatically set in ``roman''; you can
vary these conventions if necessary by typing ``{\≡\sl≡\}'' or ``{\≡\rm≡\}''.
\b To insert an illustration at the top of the next convenient page, type
$$\vbox{\halign{#\hfill\cr
{\≡\topinsert{\vskip ≡\}\<height of the illustration plus a little
white space\>\cr
{\≡\ctrline{\caption Fig.\ ≡\}\<number\>{\tt. }\<text of the caption\>{\≡}}≡\}\cr
}}$$
assuming that the caption fits on one line. This insertion usually goes into
the manuscript just after the paragraph that first refers to this
particular illustration. For example (Volume 1, page 121),
$$\vbox{\halign{#\hfill\cr
{\≡\topinsert{\vskip 5in≡\}\cr
{\≡\ctrline{\caption Fig.\ 13. The \MIX\ computer.}}≡\}\cr}}$$
\b The following example (see Chapter 4 of this manual) shows how footnotes
are treated:
$$\hbox{\≡... will never\footnote*{Well$\ldotsm$, hardly ever.} use the ...≡\}$$
\b To get the heading ``{\:<Table 1}'' centered on a line, type
$$\hbox{\≡\tablehead{Table 1}≡\}\quad.$$
For the table itself, it's best to let the author tell you exactly what he
wants, since there are so many possibilities. The control sequence {\≡\9≡\}
gives a blank space equal to the width of a digit in the current roman font;
this is occasionally useful when tables are being prepared.
\b When you really get into typing the books,
some things will occasionally arise that aren't covered here, but
this might add a little spice to
the task. The manuscript for Volume 2 of {\sl ACP}
(Second Edition) may be consulted for numerous examples of the recommended
format.
\danger Here now are the \TEX\ language definitions that explain the meanings
of all these new control sequences very precisely. All of the standard definitions
at the beginning of Appendix B are used, up until the font specifications, and
it is unnecessary to repeat them here. The remaining definitions are:
\yskip
\def\.{\noalign{\penalty-200}}
\halign{#\hfill\cr
{\≡\def\mod{\<\,\mathbin{\char'155\char'157\char'144}\penalty900\<\,}≡\}\cr
{\≡\def\modulo#1{\penalty0\;≡\}\cr
{\≡≡ ≡ (\char'155\char'157\char'144\char'165\char'154\char'157\,\,#1)}≡\}\cr
{\≡\def\deg{↑{\hbox{\hskip-1pt\:w\char5}}}≡\}\cr
\noalign{\yskip}
{\≡\:@←cmathx \:a←cmr10 ≡ \:b←cmr9 ≡ ≡ \:c←cmr8≡\}\cr
{\≡\:d←cmr7 ≡ ≡ \:e←cmr6 ≡ ≡ \:f←cmr5 ≡ ≡ \:g←cmi10≡\}\cr
{\≡\:h←cmi9 ≡ ≡ \:i←cmi8 ≡ ≡ \:j←cmi7 ≡ ≡ \:k←cmi6≡\}\cr
{\≡\:l←cmi5 ≡ ≡ \:m←cmsc10 \:n←cms10 ≡ \:o←cms9≡\}\cr
{\≡\:p←cms8 ≡ ≡ \:q←cmb10 ≡ \:r←cmb9 ≡ ≡ \:s←cmb8≡\}\cr
{\≡\:t←cmtt ≡ ≡ \:u←cmsy10 \:v←cmsy9 ≡ \:w←cmsy8≡\}\cr
{\≡\:x←cmsy7 ≡ \:y←cmsy6 ≡ \:z←cmsy5 ≡ \:;←cmtitl≡\}\cr
{\≡\:<←cmssb ≡ \:=←cmss12 \:>←cmss8 ≡ \:?←cmsss8≡\}\cr
\noalign{\yskip}
{\≡\hsize29pc \vsize45pc \maxdepth2pt \parindent19pt≡\}\cr
{\≡\topbaseline10pt \parskip0pt plus1pt \lineskip1pt≡\}\cr
{\≡\topskip24pt plus6pt minus10pt \botskip3pt plus6pt≡\}\cr
\.{\≡\def\tenpoint{\baselineskip12pt≡\}\cr
{\≡≡ ≡ \dispskip12pt plus3pt minus9pt≡\}\cr
{\≡≡ ≡ \dispaskip0pt plus3pt \dispbskip7pt plus3pt minus4pt≡\}\cr
{\≡≡ ≡ \def\rm{\:a} \def\sl{\:n} \def\bf{\:q} \def\it{\:g}≡\}\cr
{\≡≡ ≡ \def\biglp{\mathopen{\vcenter{\hbox{\:@\char'0}}}}≡\}\cr
{\≡≡ ≡ \def\bigrp{\mathclose{\vcenter{\hbox{\:@\char'1}}}}≡\}\cr
{\≡≡ ≡ \mathrm adf \mathit gjl \mathsy uxz \rm}≡\}\cr
\.{\≡\def\ninepoint{\baselineskip11pt≡\}\cr
{\≡≡ ≡ \dispskip11pt plus3pt minus8pt≡\}\cr
{\≡≡ ≡ \dispaskip0pt plus3pt \dispbskip6pt plus3pt minus3pt≡\}\cr
{\≡≡ ≡ \def\rm{\:b} \def\sl{\:o} \def\bf{\:r} \def\it{\:h}≡\}\cr
{\≡≡ ≡ \def\biglp{\mathopen{\hbox{\:a(}}}≡\}\cr
{\≡≡ ≡ \def\bigrp{\mathclose{\hbox{\:a)}}}≡\}\cr
{\≡≡ ≡ \mathrm bef \mathit hkl \mathsy vyz \rm}≡\}\cr
\.{\≡\def\eightpoint{\baselineskip9pt≡\}\cr
{\≡≡ ≡ \dispskip9pt plus3pt minus7pt≡\}\cr
{\≡≡ ≡ \dispaskip0pt plus3pt \dispbskip5pt plus3pt minus2pt≡\}\cr
{\≡≡ ≡ \def\rm{\:c} \def\sl{\:p} \def\bf{\:s} \def\it{\:i}≡\}\cr
{\≡≡ ≡ \def\biglp{\mathopen{\hbox{\:a(}}}≡\}\cr
{\≡≡ ≡ \def\bigrp{\mathclose{\hbox{\:a)}}}≡\}\cr
{\≡≡ ≡ \mathrm cef \mathit ikl \mathsy wyz \rm}≡\}\cr
\.{\≡\mathex @ \def\tt{\:t}≡\}\cr
\.{\≡\def\bigglp{\mathopen{\vcenter{\hbox{\:@\char'22}}}}≡\}\cr
{\≡\def\biggrp{\mathclose{\vcenter{\hbox{\:@\char'23}}}}≡\}\cr
{\≡\def\biggglp{\mathopen{\vcenter{\hbox{\:@\char'40}}}}≡\}\cr
{\≡\def\bigggrp{\mathclose{\vcenter{\hbox{\:@\char'41}}}}≡\}\cr
\noalign{\yskip}
{\≡\def\9{\hskip .5em}≡\}\cr
{\≡\def\xskip{\hskip7pt plus3pt minus4pt}≡\}\cr
{\≡\def\yskip{\penalty-50\vskip3pt plus3pt minus2pt}≡\}\cr
{\≡\def\yyskip{\penalty-100\vskip6pt plus6pt minus4pt}≡\}\cr
{\≡\def\sectionskip{\penalty-200\vskip24pt plus12pt minus6pt}≡\}\cr
\noalign{\yskip}
{\≡\def\textindent#1{\noindent≡\}\cr
{\≡≡ ≡ \hbox to 19pt{\hskip0pt plus1000pt minus1000pt#1 }\!}≡\}\cr
{\≡\def\hang{\hangindent19pt}≡\}\cr
\noalign{\yyskip}
{\≡\def\tpage{F} \def\rhead{} \def\frstx{F} \def\csec{} \def\chd{}≡\}\cr
{\≡\def\titlepage{\gdef\tpage{T}}≡\}\cr
{\≡\def\runninglefthead#1{\gdef\rhead{\:m#1}}≡\}\cr
\.{\≡\def\acpmark#1#2{\mark≡\}\cr
{\≡≡ ≡ {\ifeven0{\hbox to .45 in{\:a\count0\hfill}\rhead\hfill\:a#2}≡\}\cr
{\≡≡ ≡ ≡ ≡ \else{\:a\csec\hfill\:m#1\hbox to .45 in{\:a\hfill\count0}}}}≡\}\cr
\.{\≡\def\runningrighthead#1 \section#2{\acpmark{\chd}{#2}≡\}\cr
{\≡≡ ≡ \gdef\csec{#2} \gdef\chd{#1}}≡\}\cr
\.{\≡\output{\baselineskip 0pt\lineskip0pt≡\}\cr
{\≡≡ ≡ \vbox to 48pc{≡\}\cr
{\≡≡ ≡ ≡ ≡ \if T\tpage{≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ \gdef\tpage{F}≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ \vskip24pt \page \vfill \ctrline{\:c\count0}}≡\}\cr
{\≡≡ ≡ ≡ ≡ \else{\baselineskip12pt \null≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ \hbox to size{\ifeven0{\topmark}\else{\botmark}}≡\}\cr
{\≡≡ ≡ ≡ ≡ ≡ ≡ \null \page \vfill}}≡\}\cr
{\≡≡ ≡ \advcount0}≡\}\cr
\noalign{\yyskip}
{\≡\def\sectionbegin#1{\hbox{\:<#1}\penalty1000\vskip6pt plus3pt≡\}\cr
{\≡≡ ≡ \acpmark{\chd}{\csec}\noindent\tenpoint\!}≡\}\cr
\.{\≡\def\dimsectionbegin#1{\sectionskip≡\}\cr
{\≡≡ ≡ \acpmark{\chd}{\csec}\noindent{\bf#1.}\tenpoint\xskip\!}≡\}\cr
\.{\≡\def\subsectionbegin#1{\yyskip\noindent{\bf#1.}\tenpoint\xskip\!}≡\}\cr
\.{\≡\def\algbegin#1(#2). {\yyskip\noindent≡\}\cr
{\≡≡ ≡ {\bf #1}({\sl#2\/}){\bf.}\xskip}≡\}\cr
\.{\≡\def\algstep #1. [#2]{\par\yskip≡\}\cr
{\≡≡ ≡ \hang\textindent{\bf#1.}[#2]\xskip\!}≡\}\cr
\.{\≡\def\thbegin#1. {\yyskip\noindent{\bf#1.}\xskip}≡\}\cr
\.{\≡\def\proofbegin{\penalty25\vskip6pt plus12pt minus4pt≡\}\cr
{\≡≡ ≡ \noindent{\sl Proof.}\xskip}≡\}\cr
\.{\≡\def\dproofbegin{\penalty25\noindent{\sl Proof.}\xskip}≡\}\cr
\.{\≡\def\exbegin#1{\sectionskip≡\}\cr
{\≡≡ ≡ \hbox{\:<#1}\penalty1000\vskip8pt minus5pt≡\}\cr
{\≡≡ ≡ \gdef\frstx{T}\ninepoint}≡\}\cr
\.{\≡\def\ansbegin#1{\runningrighthead{ANSWERS TO EXERCISES}≡\}\cr
{\≡≡ ≡ \section{#1}\sectionskip≡\}\cr
{\≡≡ ≡ \hbox{\:<SECTION #1}\penalty1000\vskip8pt minus5pt≡\}\cr
{\≡≡ ≡ \acpmark{\chd}{\csec}\gdef\frstx{T}\ninepoint}≡\}\cr
\.{\≡\def\anskip{\par\if T\frstx{\gdef\frstx{F}}\else{\penalty-200}≡\}\cr
{\≡≡ ≡ \vskip3pt plus3pt minus1pt}≡\}\cr
\.{\≡\def\exno #1. [#2]{\anskip\textindent{\bf#1.}[{\it#2\/}]\hskip6pt}≡\}\cr
\.{\≡\def\trexno #1. [#2]{\anskip\noindent\hbox to 19pt≡\}\cr
{\≡≡ ≡ {\hskip-3.5pt\:@\char'170\hfill\bf#1. }[{\it#2\/}]\hskip6pt}≡\}\cr
\.{\≡\def\ansno #1. {\anskip\textindent{\bf#1.}}≡\}\cr
\.{\≡\def\ansnos #1,#2. {\anskip\textindent{\bf#1,}\hbox{\bf\!#2. }}≡\}\cr
\noalign{\yskip}
{\≡\def\quoteformat#1{\baselineskip11pt \def\rm{\:>} \def\sl{\:?}≡\}\cr
{\≡≡ ≡ \vskip6pt plus2pt minus2pt {\sl\halign{\rjustline{##}\cr#1}}}≡\}\cr
\.{\≡\def\author#1{\penalty1000\vskip6pt plus2pt minus2pt≡\}\cr
{\≡≡ ≡ \rm\rjustline{---#1}\vskip8pt plus4pt minus2pt}≡\}\cr
\.{\≡\def\tablehead#1{\ctrline{\:<#1}\ninepoint}≡\}\cr
\.{\≡\def\caption Fig.\ #1.{\ninepoint{\bf Fig.\ #1.}\xskip\!}≡\}\cr
\.{\≡\def\footnote#1#2{#1\botinsert{\hrule width5pc \vskip3pt≡\}\cr
{\≡≡ ≡ \baselineskip9pt\hbox par size{\eightpoint#1#2}}}≡\}\cr
\noalign{\yskip}
{\≡\def\star{\hbox to 0pt{\hskip 0pt minus 100pt *}}≡\}\cr
{\≡\def\blackslug{\hbox{\hskip1pt≡\}\cr
{\≡≡ ≡ ≡ ≡ \vrule width4pt height6pt depth1.5pt \hskip1pt}}≡\}\cr
\noalign{\yyskip}
{\≡\def\MIX{{\:t MIX}}≡\}\cr
{\≡\def\.{\hbox{\:t#1}}≡\}\cr
{\≡\def\rA{\hbox{\rm rA}} \def\rX{\hbox{\rm rX}}≡\}\cr
{\≡\def\rAX{\hbox{\rm rAX}}≡\}\cr
{\≡\def\rI{\hbox{\rm rI}} \def\rJ{\hbox{\rm rJ}}≡\}\cr
{\≡\def\understep#1{$\underline{\hbox{\sl#1}}$}≡\}\cr
\noalign{\yskip}
{\≡\def\mixtwo#1{\ninepoint\def\\{\noalign{\penalty-200}}≡\}\cr
{\≡≡ ≡ \halign{\lft{\:t##}\quad\tabskip0pt≡\}\cr
{\≡≡ ≡ ≡ ≡ ⊗\lft{\:t##}\qquad⊗\lft{\rm##}\cr#1\\}}≡\}\cr
\.{\≡\def\mixthree#1{\ninepoint\def\\{\noalign{\penalty-200}}≡\}\cr
{\≡≡ ≡ \halign{\lft{\:t##}\quad\tabskip0pt≡\}\cr
{\≡≡ ≡ ≡ ≡ ⊗\lft{\:t##}\quad⊗\lft{\:t##}\qquad⊗\lft{\rm##}\cr#1\\}}≡\}\cr
\.{\≡\def\mixfour#1{\ninepoint\def\\{\noalign{\penalty-200}}≡\}\cr
{\≡≡ ≡ \halign{\rt{\it##}\quad\tabskip0pt≡\}\cr
{\≡≡ ≡ ≡ ≡ ⊗\lft{\:t##}\quad⊗\lft{\:t##}\quad≡\}\cr
{\≡≡ ≡ ≡ ≡ ⊗\lft{\:t##}\quad⊗\lft{\rm##}\cr#1\\}}≡\}\cr
\.{\≡\def\mixfive#1{\ninepoint\def\\{\noalign{\penalty-200}}≡\}\cr
{\≡≡ ≡ \halign{\rt{\it##}\quad\tabskip0pt≡\}\cr
{\≡≡ ≡ ≡ ≡ ⊗\lft{\:t##}\quad⊗\lft{\:t##}\quad≡\}\cr
{\≡≡ ≡ ≡ ≡ ⊗\lft{\:t##}\quad⊗\ctr{$ ##$}\quad⊗\lft{\rm##}\cr#1\\}}≡\}\cr
\.{\≡\def\mixans #1. #2{\def\\{\noalign{\penalty-200}}\anskip≡\}\cr
{\≡≡ ≡ \halign{\hbox to 19pt{##}⊗\lft{\tt##}\quad≡\}\cr
{\≡≡ ≡ ≡ ≡ ⊗\lft{\tt##}\quad⊗\lft{\tt##}\quad⊗\lft{\rm##}\cr≡\}\cr
{\≡≡ ≡ ≡ ≡ {\hfill\bf #1. }#2}}≡\}\cr}
\vfill
\specialappbegin F. {Font tables}
\def\¬{\char'16 }
{\bf 1. Standard ``ascii'' code.}\xskip The American Standard Code for Information
Inter\-change deals with
characters that print and actions that don't.
The following table of 128 codes shows ``control'' symbols for codes \¬001
to \¬032, since many computer terminals generate these symbols when
the typist holds the control key down when typing a letter. These 26 codes also
have other names not shown here; for example, {\≡↑G≡\} (control-G) is also called
{\tt BEL} (ring the bell). It is rarely possible to transmit all 128 of these
symbols from your terminal to a computer and vice versa---something strange usually
happens to a few of them. But the most important ones get through.
\vfill
\moveright26pt\vbox{
\hbox{\hbox to 40pt{\hfill0\hfill}\!
\hbox to 40pt{\hfill1\hfill}\!
\hbox to 40pt{\hfill2\hfill}\!
\hbox to 40pt{\hfill3\hfill}\!
\hbox to 40pt{\hfill4\hfill}\!
\hbox to 40pt{\hfill5\hfill}\!
\hbox to 40pt{\hfill6\hfill}\!
\hbox to 40pt{\hfill7\hfill}}
\vskip 4pt
\hrule
\def\|{\vrule height 10.5pt depth 4.5pt}
\halign{\hbox to 0pt{\hskip -24pt\¬#0\hfill}⊗\|
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}\cr
00⊗{\≡NUL≡\}⊗{\≡↑A≡\}⊗{\≡↑B≡\}⊗{\≡↑C≡\}⊗{\≡↑D≡\}⊗{\≡↑E≡\}⊗{\≡↑F≡\}⊗{\≡↑G≡\}\cr
\noalign{\hrule}
01⊗{\≡↑H≡\}⊗{\≡↑I≡\}⊗{\≡↑J≡\}⊗{\≡↑K≡\}⊗{\≡↑L≡\}⊗{\≡↑M≡\}⊗{\≡↑N≡\}⊗{\≡↑O≡\}\cr
\noalign{\hrule}
02⊗{\≡↑P≡\}⊗{\≡↑Q≡\}⊗{\≡↑R≡\}⊗{\≡↑S≡\}⊗{\≡↑T≡\}⊗{\≡↑U≡\}⊗{\≡↑V≡\}⊗{\≡↑W≡\}\cr
\noalign{\hrule}
03⊗{\≡↑X≡\}⊗{\≡↑Y≡\}⊗{\≡↑Z≡\}⊗{\≡ESC≡\}⊗{\≡FS≡\}⊗{\≡GS≡\}⊗{\≡RS≡\}⊗{\≡US≡\}\cr
\noalign{\hrule}
04⊗{\≡SP≡\}⊗{\≡!≡\}⊗{\≡"≡\}⊗{\≡#≡\}⊗{\≡$≡\}⊗{\≡%≡\}⊗{\≡&≡\}⊗{\≡≡'≡\}\cr
\noalign{\hrule}
05⊗{\≡(≡\}⊗{\≡)≡\}⊗{\≡*≡\}⊗{\≡+≡\}⊗{\≡,≡\}⊗{\≡-≡\}⊗{\≡.≡\}⊗{\≡/≡\}\cr
\noalign{\hrule}
06⊗{\≡0≡\}⊗{\≡1≡\}⊗{\≡2≡\}⊗{\≡3≡\}⊗{\≡4≡\}⊗{\≡5≡\}⊗{\≡6≡\}⊗{\≡7≡\}\cr
\noalign{\hrule}
07⊗{\≡8≡\}⊗{\≡9≡\}⊗{\≡:≡\}⊗{\≡;≡\}⊗{\≡<≡\}⊗{\≡=≡\}⊗{\≡>≡\}⊗{\≡?≡\}\cr
\noalign{\hrule}
10⊗{\≡@≡\}⊗{\≡A≡\}⊗{\≡B≡\}⊗{\≡C≡\}⊗{\≡D≡\}⊗{\≡E≡\}⊗{\≡F≡\}⊗{\≡G≡\}\cr
\noalign{\hrule}
11⊗{\≡H≡\}⊗{\≡I≡\}⊗{\≡J≡\}⊗{\≡K≡\}⊗{\≡L≡\}⊗{\≡M≡\}⊗{\≡N≡\}⊗{\≡O≡\}\cr
\noalign{\hrule}
12⊗{\≡P≡\}⊗{\≡Q≡\}⊗{\≡R≡\}⊗{\≡S≡\}⊗{\≡T≡\}⊗{\≡U≡\}⊗{\≡V≡\}⊗{\≡W≡\}\cr
\noalign{\hrule}
13⊗{\≡X≡\}⊗{\≡Y≡\}⊗{\≡Z≡\}⊗{\≡[≡\}⊗{\≡\≡\}⊗{\≡]≡\}⊗{\≡≡char'17≡\}⊗$_$\cr
\noalign{\hrule}
14⊗{\≡≡`≡\}⊗{\≡a≡\}⊗{\≡b≡\}⊗{\≡c≡\}⊗{\≡d≡\}⊗{\≡e≡\}⊗{\≡f≡\}⊗{\≡g≡\}\cr
\noalign{\hrule}
15⊗{\≡h≡\}⊗{\≡i≡\}⊗{\≡j≡\}⊗{\≡k≡\}⊗{\≡l≡\}⊗{\≡m≡\}⊗{\≡n≡\}⊗{\≡o≡\}\cr
\noalign{\hrule}
16⊗{\≡p≡\}⊗{\≡q≡\}⊗{\≡r≡\}⊗{\≡s≡\}⊗{\≡t≡\}⊗{\≡u≡\}⊗{\≡v≡\}⊗{\≡w≡\}\cr
\noalign{\hrule}
17⊗{\≡x≡\}⊗{\≡y≡\}⊗{\≡z≡\}⊗{\≡{≡\}⊗{\≡|≡\}⊗{\≡}≡\}⊗{\≡≡char'24≡\}⊗{\≡DEL≡\}\cr}
\hrule}
\eject
\noindent{\bf 2. Stanford ``SUAI'' code.}\xskip The following table of 128
codes (developed about 1965 at the Stanford Artificial Intelligence Laboratory)
applies to numerous devices now used in the vicinity of Stanford University.
For the most part it is ascii code but extended to include more printing
characters. There's an unfortunate discrepancy, however, with respect
to ``{\≡}≡\}'' (\¬175 in ascii, \¬176 at SUAI); also
``{\≡≡char'24≡\}'' (\¬176 in ascii, something like \¬032 at SUAI);
also ``{\≡≡char'17≡\}'' (\¬136 in ascii, something like \¬004 at SUAI); and also
``$_$'' (\¬137 in ascii, \¬030 at SUAI).
Essentially the same code is used at Carnegie-Mellon University and at
the University of Southern California, but with
\¬176 and \¬175 switched. At the Massachusetts Institute of
Technology the code is somewhat the same but there are ten discrepancies:
codes \¬010, \¬013, \¬030, \¬032, \¬033, \¬136, \¬137, \¬175, \¬176, \¬177
are respectively called {\tt BS}, $\up$, $←$, $≠$, {\tt ESC}, \char'17,
$_$, $\}$, \char'24, {\tt DEL}.
\vfill
\moveright26pt\vbox{
\hbox{\hbox to 40pt{\hfill0\hfill}\!
\hbox to 40pt{\hfill1\hfill}\!
\hbox to 40pt{\hfill2\hfill}\!
\hbox to 40pt{\hfill3\hfill}\!
\hbox to 40pt{\hfill4\hfill}\!
\hbox to 40pt{\hfill5\hfill}\!
\hbox to 40pt{\hfill6\hfill}\!
\hbox to 40pt{\hfill7\hfill}}
\vskip 4pt
\hrule
\def\|{\vrule height 10.5pt depth 4.5pt}
\halign{\hbox to 0pt{\hskip -24pt\¬#0\hfilh∞>\|
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}\cr
00⊗\tt NUL⊗$\down$⊗$α$⊗$β$⊗$∧$⊗$¬$⊗$ε$⊗$π$\cr
\noalign{\hrule}
01⊗$λ$⊗\tt TAB⊗\tt LF⊗\tt VT⊗\tt FF⊗\tt CR⊗$∞$⊗$∂$\cr
\noalign{\hrule}
02⊗$⊂$⊗$⊃$⊗$∩$⊗$∪$⊗$∀$⊗$∃$⊗$\otimes$⊗$↔$\cr
\noalign{\hrule}
03⊗$_$⊗$→$⊗$~$⊗$≠$⊗$≤$⊗$≥$⊗$≡$⊗$∨$\cr
\noalign{\hrule}
04⊗\tt SP⊗!⊗\tt "⊗$\#$⊗$\$$⊗\%⊗&⊗'\cr
\noalign{\hrule}
05⊗(⊗)⊗*⊗+⊗,⊗-⊗.⊗/\cr
\noalign{\hrule}
06⊗0⊗1⊗2⊗3⊗4⊗5⊗6⊗7\cr
\noalign{\hrule}
07⊗8⊗9⊗:⊗;⊗<⊗=⊗>⊗?\cr
\noalign{\hrule}
10⊗$\@$⊗A⊗B⊗C⊗D⊗E⊗F⊗G\cr
\noalign{\hrule}
11⊗H⊗I⊗J⊗K⊗L⊗M⊗N⊗O\cr
\noalign{\hrule}
12⊗P⊗Q⊗R⊗S⊗T⊗U⊗V⊗W\cr
\noalign{\hrule}
13⊗X⊗Y⊗Z⊗[⊗$\rslash$⊗]⊗$\up$⊗$←$\cr
\noalign{\hrule}
14⊗`⊗a⊗b⊗c⊗d⊗e⊗f⊗g\cr
\noalign{\hrule}
15⊗h⊗i⊗j⊗k⊗l⊗m⊗n⊗o\cr
\noalign{\hrule}
16⊗p⊗q⊗r⊗s⊗t⊗u⊗v⊗w\cr
\noalign{\hrule}
17⊗x⊗y⊗z⊗$\{$⊗$|$⊗\tt ALT⊗$\}$⊗\tt BS\cr}
\hrule}
\eject
\noindent{\bf 3. \TEX\ standard roman fonts.}\xskip The following table of 128
codes shows the form \TEX\ expects its fonts to have when you use
the control sequences
for accents and special foreign letters listed in Chapter 9, or when you use
the control sequences for upper case Greek letters listed later in this appendix.\!
\xskip(Actually \TEX\ never addresses codes \¬042, \¬134, \¬136, \¬137, and \¬173 to
\¬177
directly; they are accessed indirectly via ligature information stored within
the font itself.) Codes \¬043 and \¬044 are undefined; special characters
needed in particular jobs (e.g., inverted ``?'' and ``!'' for
Spanish text) might be placed there. Note that there is agreement
with ascii code on all of its printing characters except for $\#$, $\$$, $\@$,
$\rslash$, \char'17, $_$, $\{$, $|$, $\}$, and $~$, which \TEX\ gets from
its ``symbol'' fonts. The same codes are used for slanted roman fonts like cms10.
\vfill
\moveright26pt\vbox{
\def\\{\char'}
\hbox{\hbox to 40pt{\hfill0\hfill}\!
\hbox to 40pt{\hfill1\hfill}\!
\hbox to 40pt{\hfill2\hfill}\!
\hbox to 40pt{\hfill3\hfill}\!
\hbox to 40pt{\hfill4\hfill}\!
\hbox to 40pt{\hfill5\hfill}\!
\hbox to 40pt{\hfill6\hfill}\!
\hbox to 40pt{\hfill7\hfill}}
\vskip 4pt
\hrule
\def\|{\vrule height 10.5pt depth 4.5pt}
\halign{\hbox to 0pt{\hskip -24pt\¬#0\hfill}⊗\|
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}⊗\!
\hbox to 40pt{\hfill#\hfill\|}\cr
00⊗\\000⊗\\001⊗\\002⊗\\003⊗\\004⊗\\005⊗\\006⊗\\007\cr
\noalign{\hrule}
01⊗\\010⊗\\011⊗\\012⊗\\013⊗\\014⊗\\015⊗\\016⊗\\017\cr
\noalign{\hrule}
02⊗\\020⊗\\021⊗\\022⊗\\023⊗\\024⊗\\025⊗\\026⊗\\027\cr
\noalign{\hrule}
03⊗\\030⊗\\031⊗\\032⊗\\033⊗\\034⊗\\035⊗\\036⊗\\037\cr
\noalign{\hrule}
04⊗\\040⊗\\041⊗\\042⊗\:fundefined⊗\:fundefined⊗\\045⊗\\046⊗\\047\cr
\noalign{\hrule}
05⊗\\050⊗\\051⊗\\052⊗\\053⊗\\054⊗\\055⊗\\056⊗\\057\cr
\noalign{\hrule}
06⊗\\060⊗\\061⊗\\062⊗\\063⊗\\064⊗\\065⊗\\066⊗\\067\cr
\noalign{\hrule}
07⊗\\070⊗\\071⊗\\072⊗\\073⊗\\074⊗\\075⊗\\076⊗\\077\cr
\noalign{\hrule}
10⊗\\100⊗\\101⊗\\102⊗\\103⊗\\104⊗\\105⊗\\106⊗\\107\cr
\noalign{\hrule}
11⊗\\110⊗\\111⊗\\112⊗\\113⊗\\114⊗\\115⊗\\116⊗\\117\cr
\noalign{\hrule}
12⊗\\120⊗\\121⊗\\122⊗\\123⊗\\124⊗\\125⊗\\126⊗\\127\cr
\noalign{\hrule}
13⊗\\130⊗\\131⊗\\132⊗\\133⊗\\134⊗\\135⊗\\136⊗\\137\cr
\noalign{\hrule}
14⊗\\140⊗\\141⊗\\142⊗\\143⊗\\144⊗\\145⊗\\146⊗\\147\cr
\noalign{\hrule}
15⊗\\150⊗\\151⊗\\152⊗\\153⊗\\154⊗\\155⊗\\156⊗\\157\cr
\noalign{\hrule}
16⊗\\160⊗\\161⊗\\162⊗\\163⊗\\164⊗\\165⊗\\166⊗\\167\cr
\noalign{\hrule}
17⊗\\170⊗\\171⊗\\172⊗\\173⊗\\174⊗\\175⊗\\176⊗\\177\cr}
\hrule}
\eject
\noindent{\bf 4. \TEX\ typewriter fonts.}\xskip Fixed-width fonts such as the
cmtt font shown below are sort of a cross between \TEX\ roman and SUAI codes.
All the accents and special characters of a \TEX\ roman font are present except
for {\≡\b≡\}, {\≡\l≡\}, {\≡\o≡\}, {\≡\ss≡\}, {\≡\H≡\}, and {\≡\O≡\}; and every
ascii printing character is present.\xskip (SUAI code instead of ascii code is,
however, used for the character ``{\≡}≡\}'', and \TEX\ roman code is used for
``{\tt\char'24}''.)\xskip All SUAI characters that appear in these fonts appear
in their SUAI positions, except for {\≡≡∞≡\}, {\tt\char'24}, {\≡≡≤≡\}, {\≡≡≥≡\},
and {\≡≡↓≡\}.\xskip (Furthermore you may prefer to use codes \¬015 and \¬016 in
place of \¬140 and \¬047, as done in the examples of this manual.)
\vfill
\moveright26pt\vbox{
\def\\{\char'}
\hbox{\hbox to 40pt{\hfill0\hfill}\!
\hbox to 40pt{\hfill1\hfill}\!
\hbox to 40pt{\hfill2\hfill}\!
\hbox to 40pt{\hfill3\hfill}\!
\hbox to 40pt{\hfill4\hfill}\!
\hbox to 40pt{\hfill5\hfill}\!
\hbox to 40pt{\hfill6\hfill}\!
\hbox to 40pt{\hfill7\hfill}}
\vskip 4pt
\hrule
\def\|{\vrule height 10.5pt depth 4.5pt}
\halign{\hbox to 0pt{\hskip -24pt\¬#0\hfill}⊗\|
\hbox to 40pt{\hfill\:t#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:t#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:t#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:t#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:t#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:t#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:t#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:t#\hfill\|}\cr
00⊗\\000⊗\\001⊗\\002⊗\\003⊗\\004⊗\\005⊗\\006⊗\\007\cr
\noalign{\hrule}
01⊗\\010⊗\\011⊗\\012⊗\\013⊗\\014⊗\\015⊗\\016⊗\\017\cr
\noalign{\hrule}
02⊗\\020⊗\\021⊗\\022⊗\\023⊗\\024⊗\\025⊗\\026⊗\\027\cr
\noalign{\hrule}
03⊗\\030⊗\\031⊗\\032⊗\\033⊗\\034⊗\\035⊗\\036⊗\\037\cr
\noalign{\hrule}
04⊗\\040⊗\\041⊗\\042⊗\\043⊗\\044⊗\\045⊗\\046⊗\\047\cr
\noalign{\hrule}
05⊗\\050⊗\\051⊗\\052⊗\\053⊗\\054⊗\\055⊗\\056⊗\\057\cr
\noalign{\hrule}
06⊗\\060⊗\\061⊗\\062⊗\\063⊗\\064⊗\\065⊗\\066⊗\\067\cr
\noalign{\hrule}
07⊗\\070⊗\\071⊗\\072⊗\\073⊗\\074⊗\\075⊗\\076⊗\\077\cr
\noalign{\hrule}
10⊗\\100⊗\\101⊗\\102⊗\\103⊗\\104⊗\\105⊗\\106⊗\\107\cr
\noalign{\hrule}
11⊗\\110⊗\\111⊗\\112⊗\\113⊗\\114⊗\\115⊗\\116⊗\\117\cr
\noalign{\hrule}
12⊗\\120⊗\\121⊗\\122⊗\\123⊗\\124⊗\\125⊗\\126⊗\\127\cr
\noalign{\hrule}
13⊗\\130⊗\\131⊗\\132⊗\\133⊗\\134⊗\\135⊗\\136⊗\\137\cr
\noalign{\hrule}
14⊗\\140⊗\\141⊗\\142⊗\\143⊗\\144⊗\\145⊗\\146⊗\\147\cr
\noalign{\hrule}
15⊗\\150⊗\\151⊗\\152⊗\\153⊗\\154⊗\\155⊗\\156⊗\\157\cr
\noalign{\hrule}
16⊗\\160⊗\\161⊗\\162⊗\\163⊗\\164⊗\\165⊗\\166⊗\\167\cr
\noalign{\hrule}
17⊗\\170⊗\\171⊗\\172⊗\\173⊗\\174⊗\\175⊗\\176⊗\\177\cr}
\hrule}
\eject
\noindent{\bf 5. \TEX\ standard italic fonts.}\xskip The following table
of 128 codes shows the form \TEX\ expects the italic ({\tt it}) fonts to have
in math mode, if you use the control sequences for lower case Greek letters,
upper case italic Greek letters, and a few other special symbols listed later
in this appendix. The same codes apply to text italic fonts like cmti10 and
cmu10 (the ``unslanted'' italic font used in the running heads of this manual).
Note that there is agreement with ascii code on all of its printing characters,
except for the \%\ sign and the
ten symbols that are missing in \TEX\ roman fonts (see the
previous page).
\vfill
\moveright26pt\vbox{
\def\\{\char'}
\hbox{\hbox to 40pt{\hfill0\hfill}\!
\hbox to 40pt{\hfill1\hfill}\!
\hbox to 40pt{\hfill2\hfill}\!
\hbox to 40pt{\hfill3\hfill}\!
\hbox to 40pt{\hfill4\hfill}\!
\hbox to 40pt{\hfill5\hfill}\!
\hbox to 40pt{\hfill6\hfill}\!
\hbox to 40pt{\hfill7\hfill}}
\vskip 4pt
\hrule
\def\|{\vrule height 10.5pt depth 4.5pt}
\halign{\hbox to 0pt{\hskip -24pt\¬#0\hfill}⊗\|
\hbox to 40pt{\hfill\:g#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:g#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:g#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:g#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:g#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:g#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:g#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:g#\hfill\|}\cr
00⊗\\000⊗\\001⊗\\002⊗\\003⊗\\004⊗\\005⊗\\006⊗\\007\cr
\noalign{\hrule}
01⊗\\010⊗\\011⊗\\012⊗\\013⊗\\014⊗\\015⊗\\016⊗\\017\cr
\noalign{\hrule}
02⊗\\020⊗\\021⊗\\022⊗\\023⊗\\024⊗\\025⊗\\026⊗\\027\cr
\noalign{\hrule}
03⊗\\030⊗\\031⊗\\032⊗\\033⊗\\034⊗\\035⊗\\036⊗\\037\cr
\noalign{\hrule}
04⊗\\040⊗\\041⊗\\042⊗\\043⊗\\044⊗\\045⊗\\046⊗\\047\cr
\noalign{\hrule}
05⊗\\050⊗\\051⊗\\052⊗\\053⊗\\054⊗\\055⊗\\056⊗\\057\cr
\noalign{\hrule}
06⊗\\060⊗\\061⊗\\062⊗\\063⊗\\064⊗\\065⊗\\066⊗\\067\cr
\noalign{\hrule}
07⊗\\070⊗\\071⊗\\072⊗\\073⊗\\074⊗\\075⊗\\076⊗\\077\cr
\noalign{\hrule}
10⊗\\100⊗\\101⊗\\102⊗\\103⊗\\104⊗\\105⊗\\106⊗\\107\cr
\noalign{\hrule}
11⊗\\110⊗\\111⊗\\112⊗\\113⊗\\114⊗\\115⊗\\116⊗\\117\cr
\noalign{\hrule}
12⊗\\120⊗\\121⊗\\122⊗\\123⊗\\124⊗\\125⊗\\126⊗\\127\cr
\noalign{\hrule}
13⊗\\130⊗\\131⊗\\132⊗\\133⊗\\134⊗\\135⊗\\136⊗\\137\cr
\noalign{\hrule}
14⊗\\140⊗\\141⊗\\142⊗\\143⊗\\144⊗\\145⊗\\146⊗\\147\cr
\noalign{\hrule}
15⊗\\150⊗\\151⊗\\152⊗\\153⊗\\154⊗\\155⊗\\156⊗\\157\cr
\noalign{\hrule}
16⊗\\160⊗\\161⊗\\162⊗\\163⊗\\164⊗\\165⊗\\166⊗\\167\cr
\noalign{\hrule}
17⊗\\170⊗\\171⊗\\172⊗\\173⊗\\174⊗\\175⊗\\176⊗\\177\cr}
\hrule}
\eject
\noindent{\bf 6. \TEX\ standard symbol fonts.}\xskip The following
table of 128 codes shows the form \TEX\ expects the symbol ({\tt sy}) fonts
to have in math mode, if you use the control sequences for various special
symbols listed later in this appendix, or if you use special keys on your
terminal in math mode as explained below in subsection 8. Several positions
are undefined; they can be filled with any special characters
that might be needed in a particular job.
\vfill
\moveright26pt\vbox{
\def\\{\char'}
\hbox{\hbox to 40pt{\hfill0\hfill}\!
\hbox to 40pt{\hfill1\hfill}\!
\hbox to 40pt{\hfill2\hfill}\!
\hbox to 40pt{\hfill3\hfill}\!
\hbox to 40pt{\hfill4\hfill}\!
\hbox to 40pt{\hfill5\hfill}\!
\hbox to 40pt{\hfill6\hfill}\!
\hbox to 40pt{\hfill7\hfill}}
\vskip 4pt
\hrule
\def\|{\vrule height 10.5pt depth 4.5pt}
\halign{\hbox to 0pt{\hskip -24pt\¬#0\hfill}⊗\|
\hbox to 40pt{\hfill\:u#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:u#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:u#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:u#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:u#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:u#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:u#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:u#\hfill\|}\cr
00⊗\\000⊗\\001⊗\\002⊗\\003⊗\\004⊗\\005⊗\\006⊗\\007\cr
\noalign{\hrule}
01⊗\\010⊗\\011⊗\\012⊗\\013⊗\\014⊗\\015⊗\\016⊗\\017\cr
\noalign{\hrule}
02⊗\\020⊗\\021⊗\\022⊗\\023⊗\\024⊗\\025⊗\\026⊗\\027\cr
\noalign{\hrule}
03⊗\\030⊗\\031⊗\\032⊗\\033⊗\\034⊗\\035⊗\\036⊗\\037\cr
\noalign{\hrule}
04⊗\\040⊗\\041⊗\\042⊗\\043⊗\\044⊗\\045⊗\\046⊗\\047\cr
\noalign{\hrule}
05⊗\\050⊗\\051⊗\\052⊗\\053⊗\\054⊗\\055⊗\\056⊗\\057\cr
\noalign{\hrule}
06⊗\\060⊗\\061⊗\\062⊗\\063⊗\\064⊗\\065⊗\\066⊗\:fundefined\cr
\noalign{\hrule}
07⊗\\070⊗\\071⊗\\072⊗\\073⊗\\074⊗\\075⊗\\076⊗\:fundefined\cr
\noalign{\hrule}
10⊗\\100⊗\\101⊗\\102⊗\\103⊗\\104⊗\\105⊗\\106⊗\\107\cr
\noalign{\hrule}
11⊗\\110⊗\\111⊗\\112⊗\\113⊗\\114⊗\\115⊗\\116⊗\\117\cr
\noalign{\hrule}
12⊗\\120⊗\\121⊗\\122⊗\\123⊗\\124⊗\\125⊗\\126⊗\\127\cr
\noalign{\hrule}
13⊗\\130⊗\\131⊗\\132⊗\\133⊗\\134⊗\\135⊗\\136⊗\\137\cr
\noalign{\hrule}
14⊗\\140⊗\\141⊗\\142⊗\\143⊗\\144⊗\\145⊗\\146⊗\\147\cr
\noalign{\hrule}
15⊗\\150⊗\\151⊗\\152⊗\\153⊗\\154⊗\\155⊗\:fundefined⊗\:fundefined\cr
\noalign{\hrule}
16⊗\\160⊗\\161⊗\\162⊗\\163⊗\\164⊗\\165⊗\\166⊗\:fundefined\cr
\noalign{\hrule}
17⊗\\170⊗\\171⊗\\172⊗\\173⊗\\174⊗\\175⊗\\176⊗\\177\cr}
\hrule}
\eject
\noindent{\bf 7. \TEX\ standard extension fonts.}\xskip The table of
128 codes on the next page
shows the form \TEX\ expects the extension ({\tt ex}) font to
have in math mode, if you use variable delimiters or the control
sequences for large operators listed later in this appendix.
\vfill
{\def\bracex{\leaders\hrule height 1.5pt \hfill}
\def\dnbrace{$\char'772$\bracex$\char'775
\char'774$\bracex$\char'773$}
\def\upbrace{$\char'774$\bracex$\char'773
\char'772$\bracex$\char'775$}
\hbox to size{\hfill\hbox to 250pt{\dnbrace}\hfill}
\vskip6pt
\hbox to size{\hfill$\left\{\hskip6pt\vcenter{
\hbox par 250pt{Actually
\TEX\ addresses most of these characters indirectly; for example, all
left parentheses are addressed starting with character \¬000, based on
information stored in the font itself, and the font also tells \TEX\
that arbitrarily large left parentheses can be made from characters
\¬060 (top), \¬102 (middle), \¬100 (bottom). The only codes explicitly
referred to by \TEX\ are \¬000 to \¬016, \¬110, \¬112, \¬114, \¬116,
\¬120 to \¬127, and \¬160. Thus, a font designer can move most of the
other symbols if desired, subject only to the restriction that the code number
of a large symbol be greater than the code numbers
of its smaller variants.\xskip (If
codes are changed, however, it may be necessary to change the definitions of
control sequences like {\≡\bigglp≡\} in Appendix B.) It is expected that positions
marked ``{\:fundefined}'' in this chart will be filled with characters specially
tailored to specific jobs; for example, character \¬177 is used for the
``dangerous bend'' symbol in this manual, but it might not be present in
all \TEX\ extension fonts.}}\hskip6pt\right\}$\hfill}
\vskip6pt
\hbox to size{\hfill\hbox to 250pt{\upbrace}\hfill}}
\vfill
\eject
\vfill
\moveright26pt\vbox{
\def\\{\char'}
\hbox{\hbox to 40pt{\hfill0\hfill}\!
\hbox to 40pt{\hfill1\hfill}\!
\hbox to 40pt{\hfill2\hfill}\!
\hbox to 40pt{\hfill3\hfill}\!
\hbox to 40pt{\hfill4\hfill}\!
\hbox to 40pt{\hfill5\hfill}\!
\hbox to 40pt{\hfill6\hfill}\!
\hbox to 40pt{\hfill7\hfill}}
\vskip 4pt
\hrule
\def\0{\vrule height 7.5pt depth 2.5pt}
\def\1{\vrule height 10pt depth 5pt}
\def\2{\vrule height 14.5pt depth 9.5pt}
\def\3{\vrule height 17.5pt depth 12.5pt}
\def\4{\vrule height 20.5pt depth 15.5pt}
\halign{\hbox to 0pt{\hskip -24pt$\vcenter{\hbox{\¬#0}}$\hfill}⊗\!
#⊗\hbox to 39.6pt{\hfill$\vcenter{\hbox{\:@#}}$\hfill}⊗\!
#⊗\hbox to 39.6pt{\hfill$\vcenter{\hbox{\:@#}}$\hfill}⊗\!
#⊗\hbox to 39.6pt{\hfill$\vcenter{\hbox{\:@#}}$\hfill}⊗\!
#⊗\hbox to 39.6pt{\hfill$\vcenter{\hbox{\:@#}}$\hfill}⊗\!
#⊗\hbox to 39.6pt{\hfill$\vcenter{\hbox{\:@#}}$\hfill}⊗\!
#⊗\hbox to 39.6pt{\hfill$\vcenter{\hbox{\:@#}}$\hfill}⊗\!
#⊗\hbox to 39.6pt{\hfill$\vcenter{\hbox{\:@#}}$\hfill}⊗\!
#⊗\hbox to 39.6pt{\hfill$\vcenter{\hbox{\:@#}}$\hfill}⊗\!
#⊗\hbox to 39.6pt{\hfill$\vcenter{\hbox{\:@#}}$\hfill}⊗#\cr
00⊗\1⊗\\000⊗\1⊗\\001⊗\1⊗\\002⊗\1⊗\\003⊗\1⊗\\004⊗\1⊗\\005⊗\1⊗\\006⊗\1⊗\\007⊗\1\cr
\noalign{\hrule}
01⊗\1⊗\\010⊗\1⊗\\011⊗\1⊗\\012⊗\1⊗\\013⊗\1⊗\\014⊗\1⊗\\015⊗\1⊗\\016⊗\1⊗\:f
undefined⊗\1\cr
\noalign{\hrule}
02⊗\3⊗\\020⊗\3⊗\\021⊗\3⊗\\022⊗\3⊗\\023⊗\3⊗\\024⊗\3⊗\\025⊗\3⊗\\026⊗\3⊗\\027⊗\3\cr
\noalign{\hrule}
03⊗\3⊗\\030⊗\3⊗\\031⊗\3⊗\\032⊗\3⊗\\033⊗\3⊗\\034⊗\3⊗\\035⊗\3⊗\\036⊗\3⊗\:f
undefined⊗\3\cr
\noalign{\hrule}
04⊗\4⊗\\040⊗\4⊗\\041⊗\4⊗\\042⊗\4⊗\\043⊗\4⊗\\044⊗\4⊗\\045⊗\4⊗\\046⊗\4⊗\\047⊗\4\cr
\noalign{\hrule}
05⊗\4⊗\\050⊗\4⊗\\051⊗\4⊗\\052⊗\4⊗\\053⊗\4⊗\\054⊗\4⊗\:fundefined⊗\4⊗\:f
undefined⊗\4⊗\:fundefined⊗\4\cr
\noalign{\hrule}
06⊗\2⊗\\060⊗\2⊗\\061⊗\2⊗\\062⊗\2⊗\\063⊗\2⊗\\064⊗\2⊗\\065⊗\2⊗\\066⊗\2⊗\\067⊗\2\cr
\noalign{\hrule}
07⊗\2⊗\\070⊗\2⊗\\071⊗\2⊗\\072⊗\2⊗\\073⊗\2⊗\\074⊗\2⊗\\075⊗\2⊗\\076⊗\2⊗\!
\:fundefined⊗\2\cr
\noalign{\hrule}
10⊗\2⊗\\100⊗\2⊗\\101⊗\2⊗\\102⊗\2⊗\\103⊗\2⊗\:fundefined⊗\2⊗\:fundefined⊗\2⊗\\106\!
⊗\2⊗\\107⊗\2\cr
\noalign{\hrule}
11⊗\3⊗\\110⊗\3⊗\\111⊗\3⊗\\112⊗\3⊗\\113⊗\3⊗\\114⊗\3⊗\\115⊗\3⊗\\116⊗\3⊗\\117⊗\3\cr
\noalign{\hrule}
12⊗\1⊗\\120⊗\1⊗\\121⊗\1⊗\\122⊗\1⊗\\123⊗\1⊗\\124⊗\1⊗\\125⊗\1⊗\\126⊗\1⊗\\127⊗\1\cr
\noalign{\hrule}
13⊗\3⊗\\130⊗\3⊗\\131⊗\3⊗\\132⊗\3⊗\\133⊗\3⊗\\134⊗\3⊗\\135⊗\3⊗\\136⊗\3⊗\\137⊗\3\cr
\noalign{\hrule}
14⊗\0⊗\:fundefined⊗\0⊗\:fundefined⊗\0⊗\:fundefined⊗\0⊗\:fundefined⊗\0⊗\:f
undefined⊗\0⊗\:fundefined⊗\0⊗\:fundefined⊗\0⊗\:fundefined⊗\0\cr
\noalign{\hrule}
15⊗\0⊗\:fundefined⊗\0⊗\:fundefined⊗\0⊗\:fundefined⊗\0⊗\:fundefined⊗\0⊗\:f
undefined⊗\0⊗\:fundefined⊗\0⊗\:fundefined⊗\0⊗\:fundefined⊗\0\cr
\noalign{\hrule}
16⊗\4⊗\\160⊗\4⊗\\161⊗\4⊗\\162⊗\4⊗\\163⊗\4⊗\\164⊗\4⊗\\165⊗\4⊗\\166⊗\4⊗\:f
undefined⊗\4\cr
\noalign{\hrule}
17⊗\1⊗\\170⊗\1⊗\\171⊗\1⊗\\172⊗\1⊗\\173⊗\1⊗\\174⊗\1⊗\\175⊗\1⊗\:fundefined⊗\1⊗\:f
undefined⊗\1\cr}
\hrule}
\vfill
\eject
\noindent{\bf 8. \TEX\ math mode.}\xskip When \TEX\ is in math mode, it
converts 7-bit codes into 9-bit codes according to the table below. Furthermore
a ``type'' is associated with the 9-bit code, making (almost) a 12-bit code,
since there are seven types (Ord, Op, Bin, Rel, Open, Close, Punct); see
Chapter 18. This conversion is based on the SUAI code. For example, if you
type ``{\tt→}'' at Stanford (character \¬031) the table below says that this
is converted to {\:dRel \:i441}, namely a mathematical ``relation'' found
in the {\tt sy} font as character \¬041, and this is ``$→$''.
Not all of these 128 codes can appear in character files that are prepared
with ordinary software, but the chart shows what would happen if they could.
If people at MIT ever want to use \TEX\ they will undoubtedly make changes
to the internal table that \TEX\ uses for this conversion, because of the
ten discrepancies between MIT's code and the SUAI code. However, people at
CMU or USC should have no trouble, since \TEX\ uses this table only for
characters classified as $\langle$letter$\rangle$ or $\langle$otherchar$\rangle$
(see Chapter 9).
\vfill
\moveright26pt\vbox{
\def\\{\char'}
\hbox{\hbox to 40pt{\hfill0\hfill}\!
\hbox to 40pt{\hfill1\hfill}\!
\hbox to 40pt{\hfill2\hfill}\!
\hbox to 40pt{\hfill3\hfill}\!
\hbox to 40pt{\hfill4\hfill}\!
\hbox to 40pt{\hfill5\hfill}\!
\hbox to 40pt{\hfill6\hfill}\!
\hbox to 40pt{\hfill7\hfill}}
\vskip 4pt
\hrule
\def\|{\vrule height 10.5pt depth 4.5pt}
\halign{\hbox to 0pt{\hskip -24pt\¬#0\hfill}⊗\|
\hbox to 40pt{\hfill\:e#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:e#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:e#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:e#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:e#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:e#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:e#\hfill\|}⊗\!
\hbox to 40pt{\hfill\:e#\hfill\|}\cr
00⊗Bin \:i401⊗Rel \:i443⊗Ord \:i213⊗Ord \:i214⊗Bin \:i536⊗Ord \:i472⊗Ord \:i
217⊗Ord \:i231\cr
\noalign{\hrule}
01⊗Ord \:i225⊗Ord \:i215⊗Ord \:i216⊗Op \:i563⊗Bin \:i406⊗Bin \:i410⊗Ord \:i
461⊗Ord \:i245\cr
\noalign{\hrule}
02⊗Rel \:i432⊗Rel \:i433⊗Bin \:i534⊗Bin \:i533⊗Ord \:i470⊗Ord \:i471⊗Bin \:i
412⊗Rel \:i444\cr
\noalign{\hrule}
03⊗Ord \:i465⊗Rel \:i441⊗Rel \:i430⊗Rel \:i434⊗Rel \:i424⊗Rel \:i425⊗Rel \:i
421⊗Bin \:i537\cr
\noalign{\hrule}
04⊗Ord \:i463⊗Close \:i041⊗Ord \:i541⊗Ord \:i561⊗Ord \:i577⊗Ord \:i045⊗Ord \:i
046⊗Close \:i047\cr
\noalign{\hrule}
05⊗Open \:i050⊗Close \:i051⊗Ord \:i052⊗Bin \:i053⊗Punct \:i054⊗Bin \:i400⊗Ord \:i
056⊗Ord \:i057\cr
\noalign{\hrule}
06⊗Ord \:i060⊗Ord \:i061⊗Ord \:i062⊗Ord \:i063⊗Ord \:i064⊗Ord \:i065⊗Ord \:i
066⊗Ord \:i067\cr
\noalign{\hrule}
07⊗Ord \:i070⊗Ord \:i071⊗Ord \:i072⊗Punct \:i073⊗Rel \:i074⊗Rel \:i075⊗Rel \:i
076⊗Close \:i077\cr
\noalign{\hrule}
10⊗Ord \:i574⊗Ord \:i301⊗Ord \:i302⊗Ord \:i303⊗Ord \:i304⊗Ord \:i305⊗Ord \:i
306⊗Ord \:i307\cr
\noalign{\hrule}
11⊗Ord \:i310⊗Ord \:i311⊗Ord \:i312⊗Ord \:i313⊗Ord \:i314⊗Ord \:i315⊗Ord \:i
316⊗Ord \:i317\cr
\noalign{\hrule}
12⊗Ord \:i320⊗Ord \:i321⊗Ord \:i322⊗Ord \:i323⊗Ord \:i324⊗Ord \:i325⊗Ord \:i
326⊗Ord \:i327\cr
\noalign{\hrule}
13⊗Ord \:i330⊗Ord \:i331⊗Ord \:i332⊗Open \:i133⊗Bin \:i404⊗Close \:i135⊗Rel \:i
442⊗Rel \:i440\cr
\noalign{\hrule}
14⊗Open \:i140⊗Ord \:i341⊗Ord \:i342⊗Ord \:i343⊗Ord \:i344⊗Ord \:i345⊗Ord \:i
346⊗Ord \:i347\cr
\noalign{\hrule}
15⊗Ord \:i350⊗Ord \:i351⊗Ord \:i352⊗Ord \:i353⊗Ord \:i354⊗Ord \:i355⊗Ord \:i
356⊗Ord \:i357\cr
\noalign{\hrule}
16⊗Ord \:i360⊗Ord \:i361⊗Ord \:i362⊗Ord \:i363⊗Ord \:i364⊗Ord \:i365⊗Ord \:i
366⊗Ord \:i367\cr
\noalign{\hrule}
17⊗Ord \:i370⊗Ord \:i371⊗Ord \:i372⊗Open \:i546⊗Ord \:i552⊗Bin \:i405⊗Close \:i
547⊗Bin \:i017\cr}
\hrule}
\eject
\noindent{\bf 9. Control sequences.}\xskip The tables we have seen show all of
the special symbols that appear in \TEX's standard fonts. But the question
remains, how can a person specify them on an ordinary keyboard? Well,
you can always define your favorite control sequence in terms of the {\≡\char≡\}
operation; and if you have a suitable keyboard you can type the symbols of
SUAI code directly. \TEX\ also recognizes the control sequences listed below,
when in math mode.
\yskip {\sl(a) Lower case Greek letters:}
$$
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\alpha⊗{\≡\alpha≡\}\cr
\beta⊗{\≡\beta≡\}\cr
\gamma⊗{\≡\gamma≡\}\cr
\delta⊗{\≡\delta≡\}\cr
\epsilon⊗{\≡\epsilon≡\}\cr
\zeta⊗{\≡\zeta≡\}\cr
\eta⊗{\≡\eta≡\}\cr
\theta⊗{\≡\theta≡\}\cr
\iota⊗{\≡\iota≡\}\cr}}\qquad\qquad
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\kappa⊗{\≡\kappa≡\}\cr
\lambda⊗{\≡\lambda≡\}\cr
\mu⊗{\≡\mu≡\}\cr
\nu⊗{\≡\nu≡\}\cr
\xi⊗{\≡\xi≡\}\cr
\pi⊗{\≡\pi≡\}\cr
\rho⊗{\≡\rho≡\}\cr
\sigma⊗{\≡\sigma≡\}\cr
\tau⊗{\≡\tau≡\}\cr}}\qquad\qquad
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\upsilon⊗{\≡\upsilon≡\}\cr
\phi⊗{\≡\phi≡\}\cr
\chi⊗{\≡\chi≡\}\cr
\psi⊗{\≡\psi≡\}\cr
\omega⊗{\≡\omega≡\}\cr
\varphi⊗{\≡\varphi≡\}\cr
\vartheta⊗{\≡\vartheta≡\}\cr
\varomega⊗{\≡\varomega≡\}\cr}}$$
{\sl(b) Upper case Greek letters:}$$\hbox to size{$
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\Gamma⊗{\≡\Gamma≡\}\cr
\Delta⊗{\≡\Delta≡\}\cr
\Theta⊗{\≡\Theta≡\}\cr
\Lambda⊗{\≡\Lambda≡\}\cr
\Xi⊗{\≡\Xi≡\}\cr
\Pi⊗{\≡\Pi≡\}\cr}}\hfill
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\Sigma⊗{\≡\Sigma≡\}\cr
\Upsilon⊗{\≡\Upsilon≡\}\cr
\Phi⊗{\≡\Phi≡\}\cr
\Psi⊗{\≡\Psi≡\}\cr
\Omega⊗{\≡\Omega≡\}\cr}}\hfill
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\Gammait⊗{\≡\Gammait≡\}\cr
\Deltait⊗{\≡\Deltait≡\}\cr
\Thetait⊗{\≡\Thetait≡\}\cr
\Lambdait⊗{\≡\Lambdait≡\}\cr
\Xiit⊗{\≡\Xiit≡\}\cr
\Piit⊗{\≡\Piit≡\}\cr}}\hfill
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\Sigmait⊗{\≡\Sigmait≡\}\cr
\Upsilonit⊗{\≡\Upsilonit≡\}\cr
\Phiit⊗{\≡\Phiit≡\}\cr
\Psiit⊗{\≡\Psiit≡\}\cr
\Omegait⊗{\≡\Omegait≡\}\cr}}$}$$
{\sl(c) Script letters:}$$
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\Ascr⊗{\≡\Ascr≡\}\cr
\Bscr⊗{\≡\Bscr≡\}\cr
\Cscr⊗{\≡\Cscr≡\}\cr
\Dscr⊗{\≡\Dscr≡\}\cr
\Escr⊗{\≡\Escr≡\}\cr
\Fscr⊗{\≡\Fscr≡\}\cr
\Gscr⊗{\≡\Gscr≡\}\cr
\Hscr⊗{\≡\Hscr≡\}\cr
\Iscr⊗{\≡\Iscr≡\}\cr}}\qquad\qquad
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\Jscr⊗{\≡\Jscr≡\}\cr
\Kscr⊗{\≡\Kscr≡\}\cr
\Lscr⊗{\≡\Lscr≡\}\cr
\Mscr⊗{\≡\Mscr≡\}\cr
\Nscr⊗{\≡\Nscr≡\}\cr
\Oscr⊗{\≡\Oscr≡\}\cr
\Pscr⊗{\≡\Pscr≡\}\cr
\Qscr⊗{\≡\Qscr≡\}\cr
\Rscr⊗{\≡\Rscr≡\}\cr}}\qquad\qquad
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\Sscr⊗{\≡\Sscr≡\}\cr
\Tscr⊗{\≡\Tscr≡\}\cr
\Uscr⊗{\≡\Uscr≡\}\cr
\Vscr⊗{\≡\Vscr≡\}\cr
\Wscr⊗{\≡\Wscr≡\}\cr
\Xscr⊗{\≡\Xscr≡\}\cr
\Yscr⊗{\≡\Yscr≡\}\cr
\Zscr⊗{\≡\Zscr≡\}\cr
\lscr⊗{\≡\lscr≡\}\cr}}$$
{\sl(d) Binary operators:}$$
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\pm⊗{\≡\pm≡\}\cr
\mp⊗{\≡\mp≡\}\cr
\times⊗{\≡\times≡\}\cr
\div⊗{\≡\div≡\}\cr
\rslash⊗{\≡\rslash≡\}\cr
\cdot⊗{\≡\cdot≡\}\cr}}\qquad\qquad
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\oplus⊗{\≡\oplus≡\}\cr
\ominus⊗{\≡\ominus≡\}\cr
\otimes⊗{\≡\otimes≡\}\cr
\odiv⊗{\≡\odiv≡\}\cr
\odot⊗{\≡\odot≡\}\cr
\uplus⊗{\≡\uplus≡\}\cr}}\qquad\qquad
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\ast⊗{\≡\ast≡\}\cr
\circ⊗{\≡\circ≡\}\cr
\bullet⊗{\≡\bullet≡\}\cr
\interc⊗{\≡\interc≡\}\cr
\lub⊗{\≡\lub≡\}\cr
\glb⊗{\≡\glb≡\}\cr}}$$
{\sl(e) Binary relations:}$$
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\up⊗{\≡\up≡\}\cr
\down⊗{\≡\down≡\}\cr
\←⊗{\≡\←≡\}\cr
\→⊗{\≡\→≡\}\cr
\↑⊗{\≡\↑≡\}\cr
\↓⊗{\≡\≡↓≡\}\cr
\↔⊗{\≡\≡spose←→≡\}\cr
\lsh⊗{\≡\lsh≡\}\cr
\rsh⊗{\≡\rsh≡\}\cr}}\qquad\qquad
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\perp⊗{\≡\perp≡\}\cr
\vdash⊗{\≡\vdash≡\}\cr
\dashv⊗{\≡\dashv≡\}\cr
\mapsto⊗{\≡\mapsto≡\}\cr
\relv⊗{\≡\relv≡\}\cr
\relvv⊗{\≡\relvv≡\}\cr
\subset⊗{\≡\subset≡\}\cr
\supset⊗{\≡\supset≡\}\cr
\in⊗{\≡\in≡\}\cr
\notin⊗{\≡\notin≡\}\cr}}\qquad\qquad
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\prec⊗{\≡\prec≡\}\cr
\preceq⊗{\≡\preceq≡\}\cr
\succ⊗{\≡\succ≡\}\cr
\succeq⊗{\≡\succeq≡\}\cr
\sqsub⊗{\≡\sqsub≡\}\cr
\lsls⊗{\≡\lsls≡\}\cr
\grgr⊗{\≡\grgr≡\}\cr
\simeq⊗{\≡\simeq≡\}\cr
\approx⊗{\≡\approx≡\}\cr
\doteq⊗{\≡\doteq≡\}\cr}}$$
You can also use the control sequence {\≡\not≡\} to
negate or ``cross out'' most of the relations above. For example, the symbol
``$\not\subset$'' is really two symbols, obtained by typing ``{\≡\not\subset≡\}''.\!
\xskip(Character \¬100 in the symbol font has a width of zero, so it will overlap
the following character.)\xskip But watch out: you should actually type
``{\≡\mathrel{\not\subset}≡\}'', in order to prevent \TEX\ from breaking a
line after {\≡\not≡\}.\xskip (See the definition of {\≡\neqv≡\} in Appendix B.)
\yyskip{\sl(f) Brackets:}$$
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\lfloor⊗{\≡\lfloor≡\}\cr
\lceil⊗{\≡\lceil≡\}\cr
\{⊗{\≡\{≡\}\cr
\langle⊗{\≡\langle≡\}\cr
\dleft⊗{\≡\dleft≡\}\cr
\leftv⊗{\≡\leftv≡\}\cr
\leftvv⊗{\≡\leftvv≡\}\cr}}\qquad\qquad
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\rfloor⊗{\≡\rfloor≡\}\cr
\rceil⊗{\≡\rceil≡\}\cr
\}⊗{\≡\}≡\}\cr
\rangle⊗{\≡\rangle≡\}\cr
\dright⊗{\≡\dright≡\}\cr
\rightv⊗{\≡\rightv≡\}\cr
\rightvv⊗{\≡\rightvv≡\}\cr}}$$
{\sl(g) ``Large'' operators (text and display styles):}$$\baselineskip 32pt
\hbox to size{$
\vcenter{\halign{\hfill$#$\hfill\quad⊗\hfill$\dispstyle#$\hfill\quad⊗#\hfill\cr
\sum⊗\sum⊗{\≡\sum≡\}\cr
\osum⊗\osum⊗{\≡\osum≡\}\cr
\int⊗\int⊗{\≡\int≡\}\cr
\oint⊗\oint⊗{\≡\oint≡\}\cr}}\hfill
\vcenter{\baselineskip27pt
\halign{\hfill$#$\hfill\quad⊗\hfill$\dispstyle#$\hfill\quad⊗#\hfill\cr
\inter⊗\inter⊗{\≡\inter≡\}\cr
\union⊗\union⊗{\≡\union≡\}\cr
\squnion⊗\squnion⊗{\≡\squnion≡\}\cr
\meet⊗\meet⊗{\≡\meet≡\}\cr
\join⊗\join⊗{\≡\join≡\}\cr}}\hfill
\vcenter{\halign{\hfill$#$\hfill\quad⊗\hfill$\dispstyle#$\hfill\quad⊗#\hfill\cr
\prod⊗\prod⊗{\≡\prod≡\}\cr
\oprod⊗\oprod⊗{\≡\oprod≡\}\cr
\odotprod⊗\odotprod⊗{\≡\odotprod≡\}\cr
\munion⊗\munion⊗{\≡\munion≡\}\cr}}$}$$
{\sl(h) Miscellaneous math symbols:}$$
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\iit⊗{\≡\iit≡\}\cr
\jit⊗{\≡\jit≡\}\cr
\real⊗{\≡\real≡\}\cr
\imag⊗{\≡\imag≡\}\cr
\aleph⊗{\≡\aleph≡\}\cr
\wp⊗{\≡\wp≡\}\cr}}\qquad\qquad
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\infty⊗{\≡\infty≡\}\cr
\emptyset⊗{\≡\emptyset≡\}\cr
\#⊗{\≡\#≡\}\cr
\|⊗{\≡\|≡\}\cr
\angle⊗{\≡\angle≡\}\cr
\prime⊗{\≡\prime≡\}\cr}}\qquad\qquad
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\partial⊗{\≡\partial≡\}\cr
\nabla⊗{\≡\nabla≡\}\cr
\smallint⊗{\≡\smallint≡\}\cr
\surd⊗{\≡\surd≡\}\cr
\top⊗{\≡\top≡\}\cr
\bot⊗{\≡\bot≡\}\cr}}$$
\yskip {\sl(i) Miscellaneous nonmath symbols (but allowed only in math mode):}$$
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\section⊗{\≡\section≡\}\cr
\dag⊗{\≡\dag≡\}\cr
\ddag⊗{\≡\ddag≡\}\cr
\P⊗{\≡\P≡\}\cr}}\qquad\qquad
\vcenter{\halign{\hfill$#$\hfill\quad⊗#\hfill\cr
\@⊗{\≡\@≡\}\cr
\copyright⊗{\≡\copyright≡\}\cr
\sterling⊗{\≡\sterling≡\}\cr
\$⊗{\≡\$≡\}\cr}}$$
Some of the symbols in \TEX's math fonts can be accessed directly only by using the
SUAI-oriented conversions in subsection 8. For example, the only way to get a left
arrow is by typing ``{\≡$←$≡\}''; no built-in control sequence
has been defined for it. If your keyboard doesn't have this symbol,
the remedy is to define an appropriate new control sequence, such as
$$\hbox{\≡\def\from{\mathrel{\char≡'440}}≡\}\quad.$$
\specialappbegin H. {Hyphenation}
\ninepoint
The conditions under which \TEX\ will try to hyphenate a word are discussed
in Chapter 14. Now let's consider how hyphenation is actually accomplished.
\def\.#1{\hbox{\tt#1}}
It seems to be undesirable to look for the set of all possible places to hyphenate
every given word. For one thing,
the problem is extremely difficult, since the word ``\.{record}'' is supposed to
be broken as ``\.{rec-ord}'' when it is a noun but ``\.{re-cord}''
when it is a verb. We might consider also
the word ``\.{hyphenation}'' itself, which appears to be rather an exception:
$$\hbox{\.{hy-phen-a-tion}\quad vs.\quad\.{con-cat-e-na-tion}}\quad.$$
Why does the ``\.n'' go with the ``\.a'' in one case and not the other?
Starting at letter
\.a in the dictionary and trying to find rigorous rules for hyphenation without
much knowledge, we come up against \.{a-part} vs.\ \.{ap-er-ture},
\.{aph-o-rism} vs.\ \.{a-pha-sia},
etc. It becomes clear that what we want is not an accurate but ponderously slow
routine that consumes a lot of memory space and processing time; instead we want
a set of hyphenation rules that are
$$\vbox{\halign{\hfill# ⊗#\hfill\cr
a)⊗simple enough to explain in a couple of pages,\cr
\noalign{\vskip 3pt}
b)⊗almost always safe,\cr
\noalign{\vskip 3pt}
and\quad c)⊗powerful enough that bad breaks due to
missed hyphenations are very rare.\cr}}$$
Point (c) means that a proofreader's job should be only negligibly more difficult
than it would be if an intelligent human being were doing all of the hyphenations
needed to typeset the same material.
\yyskip
So here are the rules \TEX\ uses (found with the help of Frank Liang):
\yskip\textindent{\sl 1)}{\sl Exception removal.}\xskip If
the first seven letters of the word appear in a small internal dictionary
of words to be treated specially (about 350 words in all, see below), use the
hyphenation found in that dictionary. Furthermore some of the entries in the
dictionary specify looking at more than seven letters to make sure that
the exception is real; e.g., ``\.{in-form-ant}'' wouldn't be distinguished from the
unexceptional word ``\.{in-for-ma-tion}'' on the basis of seven
letters alone. If the given
word has seven letters or fewer
and ends with ``\.s'', the word minus the \.s is also
looked up. The dictionary contains nearly all the common English words for
which the rules below would make an incorrect break, plus additional words
that are common in computer science writing and whose breaks are not satisfactorily
found by the rules.
\yskip\textindent{\sl 2)}{\sl Suffix
removal.}\xskip A permissible hyphen is inserted if the word ends with
\.{-able} (preceded by \.e, \.h, \.i, \.k, \.l, \.o, \.u, \.v, \.w, \.x, \.y or
\.{nt} or \.{rt}), \.{-ary} (preceded by \.{ion} or
\.{en}), \.{-cal}, \.{-cate} (preceded by a vowel), \.{-cial}, \.{-cious} (unless
preceded by \.s),
\.{-cient}, \.{-dent}, \.{-ful}, \.{-ize} (preceded by \.l), \.{-late} (preceded
by a vowel), \.{-less}, \.{-ly},
\.{-ment}, \.{-ness}, \.{-nary} (unless preceded by \.e or \.{io}), \.{-ogy},
\.{-rapher}, \.{-raphy},
\.{-scious}, \.{-scope}, \.{-scopic}, \.{-sion}, \.{-sphere}, \.{-tal}, \.{-tial},
\.{-tion}, \.{-tion-al}, \.{-tive},
\.{-ture}. Here a ``vowel'' is either \.a, \.e, \.i, \.o, \.u, or \.y;
the other 20 letters are ``consonants.''
There is also a somewhat more complex rule for words ending with ``\.{ing}'':
If \.{ing} is preceded by fewer than four letters, insert no permissible hyphens.
Otherwise if \.{ing} is preceded by two identical consonants other than \.f, \.l,
\.s, or
\.z, break between them. Otherwise if it is preceded by a letter other than \.l,
break the \.{-ing}. Otherwise if the letter before \.{ling} is \.b, \.c, \.d, \.f,
\.g, \.k, \.p, \.t, or \.z,
break before this letter (except break \.{ck-ling} if the word ends with
\.{ckling}). Otherwise break \.{-ing}.
Furthermore the same suffix removal routine is applied to the residual word after
having successfully found the suffixes \.{-able}, \.{-ary}, \.{-ful}, \.{-ize},
\.{-less}, \.{-ly}, \.{-ment},
and \.{-ness}. If the original word ends in \.s and no suffix was found, the
final \.s is removed and the suffix routine is applied again. If
the original word ends in \.{ed} the suffix routine is applied to the word with the
final \.d removed, and (if that is unsuccessful) to the word with final \.{ed}
removed.
Any suffixes found are effectively removed from the word, and not examined by
rules 3 and 4. If the original word ends with \.e or \.s or \.{ed}, this final
letter or pair of letters is also effectively removed.
\yskip\textindent{\sl 3)}{\sl Prefix removal.}\xskip
A permissible hyphen is inserted if the word begins with
\.{be-} (followed by \.c, \.h, \.s, or \.w), \.{com-}, \.{con-}, \.{dis-}
(unless followed by \.h or \.y),
\.{equi-} (unless followed by \.v), \.{equiv-}, \.{ex-}, \.{hand-}, \.{horse-},
\.{hy*per-}, \.{im-},
\.{in-} (but use \.{in*ter-} or \.{in*tro-} if present), \.{lex*i-}, \.{mac*ro-},
\.{math*e-},
\.{max*i-}, \.{min*i-}, \.{mul*ti-}, \.{non-}, \.{out-}, \.{over-}, \.{pseu*do-},
\.{quad-}, \.{semi-}, \.{some-},
\.{sub-}, \.{su*per-}, \.{there-}, \.{trans-} (followed by \.a, \.f, \.g, \.l, or
\.m),
\.{tri-} (followed by \.a, \.f, or \.u), \.{un*der-}, \.{un-} (unless followed by
\.{der} or \.i).
Here an asterisk denotes a second permissible hyphen to be recognized, but
only if the entire prefix appears.
After the prefixes \.{dis-}, \.{im-}, \.{in-}, \.{non-}, \.{over-}, \.{un-} have
been recognized as stated, the prefix
routine is entered again. Any prefixes found are effectively removed from
the word, and not examined by rule 4.
\yskip\textindent{\sl 4)}{\sl Study of consonant pairs.}\xskip
In the remainder of the word, after suffixes and
prefixes have been removed, we combine the letter pairs \.{ch}, \.{gh}, \.{ph},
\.{sh}, \.{th},
treating them as single consonants.
If the three-letter combination \.{XYY} is found, where \.X is a vowel and \.Y a
consonant, break between the \.Y's, except if \.Y is \.l or \.s. In the latter case,
break only if the following letter is a vowel and the word doesn't end ``\.{XYYer}''
or ``\.{XYYers}''.
If the three-letter combination \.{Xck} is found, where \.X is a vowel, break
after the \.{ck}.
If the three-letter combination \.{Xqu} is found, where \.X is a vowel, break
before the \.{qu}.
If the four-letter combination \.{XYZW} is found, where \.X and \.W are vowels and
\.Y and \.Z are consonants, break between the consonants unless \.{YZ} is one of
the following pairs:
$$\vbox{\halign{\hfill\tt#\hfill\cr
bl, br, cl, cr, chl, chr, dg, dr, fl, fr, ght, gl, gr, kn, lk, lq,\cr
nch, nk, nx, phr, pl, pr, rk, sp, sq, tch, tr, thr, wh, wl, wn, wr.\cr}}$$
Furthermore do not break between the consonants if the word ends with
\.{XYZer}, \.{XYZers}, \.{XYZage}, \.{XYZages},
or \.{XYZest}, when \.{YZ} is one of the pairs
$$\.{ft, ld, mp, nd, ng, ns, nt, rg, rm, rn, rt, st.}$$
\yskip\textindent{\sl 5)}{\sl Retaining short ends.}\xskip
After applying rules 1, 2, 3, and 4, take back all ``permissible'' breaks that
result in only one or two letters after the break, or that have only one
letter before it, or that have only one letter between prefix and suffix.\xskip
(Thus, for example, the suffix rule will break \.{-ly}, but this won't
count in the final analysis; it does affect the hyphenation algorithm, however,
since the suffixes in words like ``\.{rationally}'' will be found by repeated
suffix removal.)
Also, take back any break leading to the syllable \.{-e}, \.{-Xe}, or \.{-XYe},
where
\.X and \.Y are any two letters and where this \.e occurs at the end of the shortest
subword on which suffix removal was tried in rule 2.\xskip
(This rule avoids syllables
with ``silent e''. For example, we do not wish to hyphenate \.{rid-dle},
\.{proces-ses},
\.{was-teful}, \.{arran-gement}, \.{themsel-ves}, \.{lar-gely}, and so on.)\xskip
Similarly, final syllables of the form \.{-Xed} or \.{-XYed} (except \.{-ized}) are
also disregarded.
\yyskip {\bf Example of hyphenation:}$$\.{su-per-califragilis-ticex-pialido-cious.}
$$(This is a correct subset of the ``official'' syllabification specified
by the coiners of this word, namely
{\tt su-per-cal-i-frag-il-is-tic-ex-pi-al-i-do-cious}.)
\yskip Now here's the dictionary of words that should be handled separately,
as mentioned in rule 1.\xskip
(When an asterisk appears, it means that this letter is checked too, in addition
to the first seven letters.)
First, we include the following words since they are exceptions to the
suffix rules:
$$\def\\{\noalign{\penalty-200}}\halign{\tt# \hfill⊗\tt#\hfill\cr
(-able)⊗con-trol-lable eq-uable in-sa-tiable ne-go-tiable\cr
⊗so-ciable turn-table un-con-trollable un-so-ciable\cr
(-dent)⊗de-pend-ent in-de-pend-ent\cr
\\(-ing)⊗any-thing bal-ding dar-ling dump-ling err-ing eve-ning\cr
⊗every-thing far-thing found-ling ink-ling main-spring\cr
⊗nest-ling off-spring play-thing sap-ling shoe-string\cr
⊗sib-ling some-thing star-ling ster-ling un-err-ing\cr
⊗up-swing weak-ling year-ling\cr
\\(-ize)⊗civ-i-lize crys-tal-lize im-mo-bi-lize me-ta-bo-lize\cr
⊗mo-bi-lize mo-nop-o-lize sta-bi-li*ze tan-ta-lize\cr
⊗un-civ-i-lized\cr
\\(-late)⊗pal-ate\cr
\\(-ment)⊗in-clem-ent\cr
\\(-ness)⊗bar-on-ess li-on-ess\cr
\\(-ogy)⊗eu-logy ped-a-gogy \cr
\\(-scious)⊗lus-cious\cr
\\(-sphere)⊗at-mos-phere\cr
\\(-tal)⊗met-al non-metal pet-al post-al rent-al\cr
(-tion)⊗cat-ion\cr
(-tive)⊗com-bat-ive\cr
(-ture)⊗stat-ure\cr}$$
Exceptions to the prefix rules:
$$\halign{\tt# \hfill⊗\tt#\hfill\cr
(be-)⊗beck-on bes-tial\cr
(com-)⊗com-a-tose come-back co-me-dian comp-troller\cr
(con-)⊗cone-flower co-nun-drum\cr
(equi-)⊗equipped\cr
(hand-)⊗handle-bar\cr
(in-)⊗inch-worm ink-blot inn-keeper\cr
(inter-)⊗in-te-rior\cr
(mini-)⊗min-is-ter min-is-try\cr
(non-)⊗none-the-less\cr
(quad-)⊗qua-drille\cr
(some-)⊗som-er-sault\cr
(super-)⊗su-pe-rior\cr
(un-)⊗u-na-nim-ity u-nan-i-mous unc-tuous\cr}$$
Exceptions to the consonant rules:
$$\def\\{\noalign{\penalty-200\vskip.5pt plus .5pt}}\halign{\tt# \hfill⊗\tt
#\hfill\cr
bt:⊗debt-or \cr
\\ck:⊗ac-know-ledge\cr
\\ct:⊗de-duct-i*ble ex-act-i-tude in-ex-act-i-tude\cr
⊗pre-dict-*able re-spect-*able un-pre-dict-able vict-ual\cr
\\dl:⊗needle-work idler\cr
\\ff:⊗buff-er off-beat off-hand off-print off-shoot off-shore stiff-en\cr
\\ft:⊗left-ist left-over lift-off\cr
\\fth:⊗soft-hearted\cr
\\gg:⊗egg-nog egg-head\cr
\\gn:⊗cognac for-eign-er vignette\cr
\\gsh:⊗hogs-head\cr
\\ld:⊗child-ish eld-est gold-en hold-out hold-over hold-up\cr
\\lf:⊗self-ish\cr
\\ll:⊗bull-ish crest-fallen dis-till-*ery fall-out lull-aby\cr
⊗roll-away sell-out wall-eye\cr
\\lm:⊗psalm-ist\cr
\\ls:⊗else-where false-hood\cr
\\lt:⊗con-sult-ant volt-age\cr
\\lv:⊗re-solv-able re-volv-er solv-able un-solv-able\cr
\\mb:⊗beach-comber bomb-er climb-er plumb-er\cr
\\mp:⊗damp-en damp-est\cr
\\nch:⊗clinch-er launch-er lunch-eon ranch-er trench-ant\cr
\\nc:⊗an-nouncer bouncer fencer hence-forth mince-meat si-lencer\cr
\\nd:⊗bind-ery bound-ary com-mend-*a-*t*ory de-pend-able\cr
⊗ex-pend-able fiend-ish land-owner out-land-ish round-about\cr
⊗send-off stand-out un-der-stand-able\cr
\\ng:⊗change-over hang-out hang-over ha-rangue me-ringue\cr
⊗orange-ade tongue venge-ance\cr
\\ns:⊗sense-less\cr
\\nt:⊗ac-count-ant ant-acid ant-eater count-ess per-cent-*age\cr
⊗rep-re-sentative\cr
\\nth:⊗ant-hill pent-house\cr
\\pt:⊗ac-cept-able ac-ceptor adapt-able adapt-er crypt-analysis\cr
⊗in-ter-ru*p*t-*i*ble\cr
\\qu:⊗an-tiq-uity ineq-uity iniq-uity liq-uefy liq-uid liq-ui-date\cr
⊗liq-ui-da-tion liq-uor pre-req-ui-site req-ui-si-tion\cr
⊗sub-sequence u-biq-ui-tous\cr
\\rb:⊗ab-sorb-ent carb-on herbal im-per-turb-able\cr
\\rch:⊗arch-ery arch-an-gel re-search-er un-search-able\cr
\\rd:⊗ac-cord-ance board-er chordal hard-en hard-est haz-ard-ous\cr
⊗jeop-ard-ize re-corder stand-ard-ize stew-ard-ess yard-age\cr
\\rf:⊗surf-er\cr
\\rg:⊗morgue\cr
\\rl:⊗curl-i-cue\cr
\\rm:⊗af-firm-a*t*i*ve con-form-*ity de-form-ity in-form-a*nt\cr
⊗non-con-form-ist\cr
\\rn:⊗cav-ern-ous dis-cern-ible mod-ern-ize turn-about turn-over\cr
⊗un-gov-ern-able west-ern-ize\cr
\\rp:⊗harp-ist sharpen\cr
\\rq:⊗torque\cr
\\rs:⊗coars-en ir-re-vers-ible nurse-maid nurs-ery\cr
⊗re-hears-al re-vers-ible wors-en\cr
\\rt:⊗art-ist con-vert-ible court-yard fore-short-en heart-ache\cr
⊗heart-ily short-en\cr
\\rth:⊗apart-heid court-house earth-en-ware north-east north-ern\cr
⊗port-hole\cr
\\rv:⊗nerv-ous ob-serv-a*ble ob-server pre-serv-*a*t*i*ve serv-er\cr
⊗serv-ice-able\cr
\\sch:⊗pre-school\cr
\\sc:⊗con-de-scend cre-scendo de-cre-scendo de-scend-ent de-scent\cr
⊗pleb-i-scite re-scind sea-scape\cr
\\sk:⊗askance snake-skin whisk-er\cr
\\sl:⊗cole-slaw\cr
\\sn:⊗rattle-snake\cr
\\ss:⊗class-ify class-room cross-over dis-miss-al ex-press-*i*ble\cr
⊗im-pass-able less-en pass-able toss-up un-class-i-fied\cr
\\st:⊗ar-mi-stice astig-ma-tism astir astonish-ment blast-off\cr
⊗by-stand-er candle-stick cast-away cast-off con-test-ant\cr
⊗co-star de-test-able di-gest-ible east-ern ex-ist-ence\cr
⊗fore-stall in-con-test-able in-di-ges*t-*i*ble\cr
⊗in-ex-haust-ible life-style lime-stone live-stock mile-stone\cr
⊗non-ex-ist-ent per-sist-ent pho-to-stat re-start-ed\cr
⊗re-state-ment re-store shy-ster side-step smoke-stack\cr
⊗sug-gest-*i*ble thermo-stat waste-bas-ket waste-land\cr
\\sth:⊗mast-head post-hu-mous priest-hood\cr
\\sw:⊗side-swipe\cr
\\tt:⊗watt-meter\cr
\\tw:⊗be-tween\cr
\\tz:⊗kib-itzer\cr
\\zz:⊗buzz-er\cr}$$
Of course, this is not a complete list of exceptions. But it does seem to
cover all words that have a reasonably high chance of being mis-hyphenated
in \TEX's output,
considering the fact that \TEX\ usually finds a good way to break a
paragraph without any hyphenation at all.
The following words have been also been included in the special dictionary,
because they are common in the author's vocabulary, and because they need more
hyphens than \TEX\ would otherwise find:
$$\vcenter{\halign{\tt#\hfill\cr
al-go-rithm\cr
bib-li-og-raphy\cr
bi-no-mial\cr
cen-ter\cr
com-put-a*bil-ity\cr
dec-la-ra-tion\cr
de-gree\cr}}\qquad\qquad
\vcenter{\halign{\tt#\hfill\cr
es-tab-lish\cr
gen-er-ator\cr
hap-hazard\cr
neg-li-gible\cr
pe-ri-odic\cr
poly-no-mial\cr
pre-vious\cr}}\qquad\qquad
\vcenter{\halign{\tt#\hfill\cr
prob-abil-ity\cr
prob-able\cr
pro-ce-dure\cr
pub-li-ca-tion\cr
pub-lish\cr
re-place-ment\cr
when-ever\cr}}$$
\vfill
\specialappbegin I. {Index}
\def\index{T} \def\1{T} \def\lr{L}
\def\indexoutput{\if T\1{\gdef\1{F}\vsize31pc\hsize164pt\save1\page\gdef\2{T}}
\else{ % Not the beginning of the appendix
\if L\lr{\gdef\lr{R}\save0\page}
\else{ % Not the left-hand column
\gdef\lr{L}\save3\hbox to 348pt{\box0\hfill\page}
\if T\2{\gdef\2{F}\save3\vbox to 36pc{\box1\vskip0pt minus100000000pt
\box3}\vsize36pc}\else{}
\moveleft 10pt\vbox to 36pt{\hrule % horizontal rule at top of page
\hbox to 368pt{\trule\ifeven0{\topmark}\else{\botmark}\trule}
\hrule\vfill} % horizontal rule under the headline
\box3\advcount0} % insert the page contents
}}
This index includes all control sequences known to \TEX\ or defined in
Appen\-dix\penalty1000\ B,
and it also lists error messages that are mentioned outside of Chapter 27.
\vfill\eject % this page will be overlapped, when \2 is T
\def\¬{\par\hangindent 16pt \noindent\!}
\def\*{\par\penalty1000\hangindent 16pt}
\def\newletter#1{\par\penalty-300
\vskip10pt plus5pt minus5pt
\hangindent 16pt\noindent\!}
\def\<{$\langle$}\def\>{$\rangle$}
\eightpoint \parindent 8pt \jpar1000 \ragged 1000 \chpar2←1000
\hangindent 16pt \noindent
{\≡\A≡\} (circumflex), 38, 64, 132.\¬
{\≡\a≡\} (Scandinavian accent), 38--39, 132.\¬
Abbreviations, 49, 154.\¬
{\≡\above≡\} (general fraction), 68, 134, 139.\¬
Absolute value, 76, 84, 87.\¬
{\≡\accent≡\} (nonstandard accent character), 36, 82, 132.\¬
\<accent\>, 123, 132, 143.\¬
Accents, 8, 10, 35--36, 38--39, 44, 53--54, 123, 143.
\*in math formulas, 64, 132--133.
\*table, 38.\¬
Acute accent, 8, 10, 35, 132.\¬
{\≡\advcount≡\} (advance a counter), 60, 111, 113, 120, 129, 137, 199.\¬
{\≡\AE≡\} ( \AE\ ), 37, 122.\¬
{\≡\ae≡\} ( \ae\ ), 37, 122, 148.\¬
{\tt after}, 56, 120, 129.\¬
{\≡\aleph≡\} ( $\aleph$ ), 10, 179.\¬
Alignment, 104--109, 117--118, 126--127, 135, 140, 144.\¬
{\tt alignsize}, 144.\¬
{\≡\alpha≡\} ( $\alpha$ ), 35, 61, 132, 177.\¬
\<alt-mode\>\ ({\tt ALT}), 32, 165.\¬
{\≡! Ambiguous...≡\}, 134, 139.\¬
{\≡\angle≡\} ( $\angle$ ), 179.\¬
Angle brackets, 41, 75, {\sl see also} {\≡\langle≡\}, {\≡\rangle≡\}.\¬
Angstrom unit, 38--39.\¬
Answers to the exercises, 148--151.\¬
Apostrophe, 4.\¬
{\≡\approx≡\} ( $\approx$ ), 52, 61, 178.\¬
Argument, 97.\¬
Ascii, 168.\¬
{\≡\Ascr≡\} ( $\Ascr$ ), 10, 177.\¬
{\≡\ast≡\} ( $\ast$ ), 178.\¬
AT&T, 108.\¬
\<atom\>, 84, 132.\¬
{\≡\atop≡\} (ruleless fraction), 67, 71, 134, 139, 149.
\newletter b
{\≡\b≡\} (vector accent), 38, 64, 132.\¬
Backslash, 7, 28.\¬
Backspace, 45, {\sl see also} \<delete\>, Negative glue, {\≡\spose≡\},
{\≡\unskip≡\}.\¬
Badness, 47, 55, 58.\¬
Bar accent, 38--39, 64, 132.\¬
Baseline, 14--15, 42--45.\¬
{\≡\baselineskip≡\} (normal vertical spacing between baselines), 18, 58, 60,
100, 109, 112, 115, 118, 119, 127, 128, 136, 149, 153, 199.\¬
Basic \smallTEX\ format, 10, 19, 151--153.\¬
{\tt basic.TEX}, 19, 151--153.\¬
{\≡\beta≡\} ( $\beta$ ), 61, 132, 177.\¬
{\≡\bf≡\} (boldface), 12, 153.\¬
Bibliographic references, 15, 154.\¬
{\≡\biggglp≡\} (superlarge left parenthesis), 78, 153.\¬
{\≡\bigggrp≡\} (superlarge right parenthesis), 78, 153.\¬
{\≡\bigglp≡\} (large left parenthesis), 77--78, 96, 149, 153.\¬
{\≡\biggrp≡\} (large right parenthesis), 78, 96, 149, 153.\¬
{\≡\biglp≡\} (largish left parenthesis), 78, 81--82, 97, 149, 153.\¬
{\≡\bigrp≡\} (largish right parenthesis), 78, 81--82, 97, 149, 153.\¬
Bin box, 82--85, 132--133, 176.\¬
Binary operation, 55--56, 82--83, 96, 178.\¬
Black box, 43.\¬
{\≡\blackslug≡\} ( \hbox{\hskip 1pt\vrule width3.2pt height4.8pt depth1.2pt
\hskip1pt} ), 158, 167.\¬
Blank delimiter, 75--77.\¬
Blank line, 23, 28, 32.\¬
Blank space character, 5, 8--9, 12, 17, 25, 28, 30--33, 38, 41, 61, 80, 98, 106,
114.
\*summary, 33.\¬
{\≡\bot≡\} ( $\bot$ ), 179.\¬
{\≡\botinsert≡\} (insertion at bottom of page), 52, 54, 57, 59, 118, 127, 167.\¬
{\≡\botmark≡\} (current mark at bottom of page), 110--111, 117, 126, 135, 166, 199.\¬
{\≡\botskip≡\} (glue above {\≡botinsert≡\}), 59, 119, 128, 136.\¬
Bound insertion, 127.\¬
{\≡\box≡\} ({\≡\save≡\}d box), 101, 102, 115--116, 124, 133.\¬
\<box\>, 115, 124, 133.\¬
Boxes, 41--46, 99--103.\¬
{\≡\boxit≡\}, 101.\¬
Braces, variable-width horizontal, 103, 174.\¬
Braces, variable-width vertical, 75, 174.\¬
Breaking lists of lines into pages, 57--60.\¬
Breaking math formulas, in text, 54--55, 84--85, 120, 129.
\*in displays, 94--96.\¬
Breaking paragraphs into lines, 25--26, 52--57, 71, 101.\¬
Breaks between pages, legal, 57.\¬
Breaks in paragraph, feasible, 55.
\*legal, 54--55.\¬
Breve accent, 38--39, 132.\¬
{\≡\Bscr≡\} ( $\Bscr$ ), 10, 177.\¬
{\≡\bullet≡\} ( $\bullet$ ), 159, 178.
\newletter c
{\≡\c≡\} (cedilla accent), 23, 38--39, 132.\¬
Calculus, 81--82.\¬
Capacity of \smallTEX, 143--144.\¬
{\≡\≡\}\<carriage-return\>, 12.\¬
\<carriage-return\>\ ({\tt CR}), 21, 28, 29, 32, 95, 165.\¬
Case shifts, 199.\¬
{\≡\cdot≡\} ( $\cdot$ ), 178.\¬
{\≡\cdots≡\} ( $\cdots$ ), 86, 149, 152.\¬
{\≡\cdotss≡\} ({\≡\cdots≡\} followed by space), 86--87, 152.\¬
Cedilla accent, 23, 37--39.\¬
{\≡\char≡\} (specified character number), 34, 73--74, 79, 84, 116, 123, 132.\¬
\<char\>, 116.\¬
Character categories, table, 28.\¬
Character conversion in math mode, 35, 60, 176.\¬
{\≡\chcode≡\} (change category code), 18, 32, 115, 119, 128, 131, 137, 141, 148,
151, 200.\¬
{\≡\chi≡\} ( $\chi$ ), 4, 149, 177.\¬
{\≡\choose≡\} (binomial coefficient), 67--69, 149, 152.\¬
{\≡\chop≡\} (change depth of box), 78, 150, 152.\¬
{\≡\chpar≡\} (change \smallTEX\ integer parameter), 56, 59, 85, 115, 119--120,
128--129, 137, 141.\¬
{\≡\circ≡\} ( $\circ$ ), 178.\¬
Circumflex accent, 38, 64, 132.\¬
Close box, 82--84, 133, 176.\¬
{\tt cm} (centimeter), 10, 40--41.\¬
cmathx, 103, 153, 174--175.\¬
cmb10, 36, 153, 170.\¬
cmi10, 74, 132, 172.\¬
cmr10, 14, 26, 36, 42, 103, 153, 170.\¬
cms10, 36, 42, 153, 170.\¬
cmss10, 36, 170.\¬
cmsy10, 153, 173.\¬
cmti10, 74, 153, 172.\¬
cmu10, 172.\¬
Colon, 48.\¬
Colon-equal operator, 91.\¬
{\≡\comb≡\} (combinatorial formula), 64, 69, 134, 139.\¬
Comma, 48, 71--72, 82, 85.\¬
Computer Modern fonts, 14, 170.\¬
Conditional text, 111--114, 121, 130, 137, 140, 150.\¬
Consonant, 181.\¬
Contents of this manual, table, 3.\¬
Continued fractions, 69.\¬
Control sequences, 8--12, 21, 27, 30--31, 33, 98, 114--115, 122, 131.
\*complete list, 187-197.
\*how to define, 96--99.
\*tracing, 147.\¬
Control space, 8--9, 12, 33, 49, 81, 123, 133.\¬
Conversion of characters in math mode, 35, 60, 176.\¬
{\≡\copyright≡\} ( $\copyright$ ), 61, 179.\¬
{\≡\cos≡\} (cosine operator), 72--73, 151.\¬
{\≡\cot≡\} (cotangent operator), 72, 151.\¬
{\≡\count≡\} (value of a counter), 34, 60, 111--113, 120, 129, 137, 199.\¬
Counters, 111, 120, 129, 137, 199.\¬
{\≡\cpile≡\} (centered pile), 89, 93, 152.\¬
{\≡\cr≡\} (end of row or column to be aligned), 88--89, 104--107, 117--118, 126--127,
135, 140, 144.\¬
{\≡\csc≡\} (cosecant operator), 72, 151.\¬
{\≡\Cscr≡\} ( $\Cscr$ ), 177.\¬
{\≡\ctr≡\} (centerify), 88--89, 104--106, 151.\¬
{\≡\ctrline≡\} (centered line), 15--16, 20--21, 26--27, 50, 112, 151.\¬
Cube root, 63.\¬
Current font selections, 12--15, 18, 36, 73, 115, 118--119, 127--128, 118--119,
127--128, 140, 145.\¬
Current math fonts, 73--74, 118--119, 127--128.
\newletter d
{\≡\dag≡\} ( $\dag$ ), 61, 179.\¬
Dangerous bend, 2, 47, 74.\¬
Dash, 5--6, 20, 27, 29, 35, 54, 80.\¬
{\≡\dashv≡\} ( $\dashv$ ), 178.\¬
{\tt dd} (Didot point), 40.\¬
{\≡\ddag≡\} ( $\ddag$ ), 61, 179.\¬
{\≡\ddt≡\} (debugging aid), 121, 130, 137, 142.\¬
{\≡\def≡\} (define a control sequence), 7, 16, 18, 33, 96--99, 112, 115, 118,
122, 127, 131, 136, 141, 143, 146, 151--153.\¬
Definition of control sequences, {\sl see} {\≡\def≡\}.\¬
{\≡\deg≡\} (degree symbol), 154, 164.\¬
\<delete\>\ ({\tt BS}), 32, 165.\¬
\<delim\>, 75, 79.\¬
{\≡\Delta≡\} ( $\Delta$ ), 177.\¬
{\≡\delta≡\} ( $\delta$ ), 61, 177.\¬
{\≡\Deltait≡\} ( $\Deltait$ ), 177.\¬
Demerits, 55--56.\¬
Denominator, 66, 134.\¬
Depth, 41--45.
\*of completed page, 59.\¬
{\tt depth}, 99.\¬
{\≡\det≡\} (determinant operator), 72, 152.\¬
Dick and Jane, 48.\¬
Didot point, 40.\¬
Digit-width space, 164, 165.\¬
\<dimen\>, 41, 141.\¬
\<dimenparam\>, 119, 128, 136, 199.\¬
Dimension parameters, 119, 128, 136, 199.\¬
Dimensions, 40--42, 199--200.\¬
Discretionary hyphen, 26, 54--55, 124, 143.\¬
Discretionary times sign, 55, 85, 134.\¬
{\≡\dispaskip≡\} (glue above display following short line), 92, 119, 128,
136, 153.\¬
{\≡\dispbskip≡\} (glue below display following short line), 92, 119, 128,
136, 153.\¬
\<display\>, 125, 130.\¬
Display break penalty, 120, 129.\¬
Display math mode, 50--52.
\*summary, 130--138.\¬
Display style, 65--67, 92.\¬
Displayed formulas, 58, 91--96.\¬
{\≡\dispskip≡\} (glue above and below displays), 92, 119, 128, 136, 153.\¬
{\≡\dispstyle≡\} (display style), 68, 135.\¬
{\≡\div≡\} ( $\div$ ), 178.\¬
{\≡\dleft≡\} ( $\dleft$ ), 178.\¬
{\≡\doteq≡\} ( $\doteq$ ), 10, 178.\¬
Dotless letters, {\sl see} {\≡\i≡\}, {\≡\j≡\}, {\≡\iit≡\}, {\≡\jit≡\}.\¬
Dots, 85--87, 90--91.\¬
{\≡! Double ...≡\}, 132, 140.\¬
{\≡\down≡\} ( $\down$ ), 178.\¬
{\≡dp≡\} (depth of saved box), 200.\¬
{\≡\dright≡\} ( $\dright$ ), 178.\¬
{\≡\Dscr≡\} ( $\Dscr$ ), 177.\¬
Dynamic programming, 55.
\newletter e
Editing on-line, 22, 147.\¬
{\≡\eject≡\} (force page break and line break), 24, 54--55, 57, 84, 112, 117,
126, 135.\¬
Ellipses (three dots), 49, 85--87, 90--91.\¬
{\≡\else≡\} (begin false text of conditional input), 33, 111--114, 121, 130,
137, 140.\¬
{\≡em≡\} (em unit), 40.\¬
Em-dash, 5--6, 27, 29, 80.\¬
{\≡\emptyset≡\} ( $\emptyset$ ), 179.\¬
En-dash, 5--6, 17, 35, 148, 155.\¬
{\≡\end≡\} (terminate \smallTEX), 23, 52, 121, 140.\¬
End of line, 28, 30--31, 33.\¬
End of page in input file, 32, 141.\¬
End of paragraph, 23, 28, 30--32, 51, 57, 114, 125, 135, 146.\¬
{\≡\ENDV≡\}, 118, 126--127.\¬
{\≡\epsilon≡\} ( $\epsilon$ ), 4, 61, 177.\¬
{\≡\eqalign≡\} (align equations), 92--96, 107, 152.\¬
{\≡\eqalignno≡\} (align numbered equations), 93--94, 107, 152.\¬
{\≡\eqno≡\} (displayed equation number), 91--94, 135--136.\¬
Equation numbers, 91--94, 135.\¬
{\≡\eqv≡\} ( $≡$ ), 88, 152.\¬
Error messages, 187, {\sl see also} Error recovery.
\*complete list, 139--146.\¬
Error recovery, 21--27, 114--115, 122, 131, 138--148.\¬
{\tt errors.tmp}, 24, 26, 147.\¬
Escape character, 7, 18, 28, 30--32.\¬
Escape space, 8--9, 12, 33, 49, 81, 123, 133.\¬
{\≡\Escr≡\} ( $\Escr$ ), 177.\¬
{\≡\eta≡\} ( $\eta$ ), 177.\¬
{\tt ex} fonts, 73--74, 79, 118, 124, 125, 127, 134, 174--175.\¬
Exception dictionary, 182--186.\¬
Exclamation point, 48, 71, 82.\¬
Exercises, 2.
\*answers, 148--151.\¬
{\≡\exp≡\} (exponential operator), 72--73, 152.\¬
{\tt expand}, 100, 104, 115, 124, 133.\¬
Expansion of macros, 98, 106--107, 147, 199.\¬
Extension fonts, 73--74, 79, 118, 124, 125, 127, 134, 174--175.\¬
Extensions to \smallTEX, 117, 126, 135, 198, 199.\¬
{\≡! Extra \right≡\}, 131, 140.\¬
{\≡! Extra }≡\}, 115, 122, 131, 140.
\newletter f
Factorial, 82, 91.\¬
Feasible breaks in paragraph, 55.\¬
ffl, {\sl see} Ligatures.\¬
File name, 25, 33, 121, 139.\¬
{\≡\firstmark≡\} (first mark on page), 110--111, 117, 126, 135, 166, 199.\¬
Floating insertion, 59, 118, 127.\¬
{\tt fmemsize}, 144.\¬
\<font\>, 74, 118--119, 127--128, {\sl see also} Font codes.\¬
Font codes, 13--14, 33, 141.
\*table, 14.\¬
Font definition, 12--15, 18, 36, 73--74, 115, 118--119, 127--128, 118--119,
127--128, 140, 145.\¬
Font tables, 168--179.\¬
Fonts, 12--15.\¬
{\≡\footnote≡\} (insert footnote), 13, 164, 167.\¬
Footnotes, 12--13, 164.\¬
Footnotes, 164.\¬
{\tt for}, 56, 120, 129.\¬
Foreign language characters and accents, 37--39, 53--54.\¬
\<form-feed\>\ ({\tt FF}), 29, 32, 165.\¬
{\≡\≡\}\<form-feed\>, 12.\¬
\<format\>, 104--106.\¬
\<formula\>, 91, 125, 130.\¬
Fractions, 64--69, 134.\¬
{\≡\Fscr≡\} ( $\Fscr$ ), 17
\newletter g
{\≡\Gamma≡\} ( $\Gamma$ ), 11, 61, 177.\¬
{\≡\gamma≡\} ( $\gamma$ ), 11, 61, 177.\¬
{\≡\Gammait≡\} ( $\Gammait$ ), 177.\¬
{\≡\gcd≡\} (greatest common divisor operator), 72, 88, 152.\¬
{\≡\gdef≡\} (global {\≡\def≡\}), 18, 98, 112, 115, 118, 122, 127, 131, 136, 146,
199.\¬
{\≡\glb≡\} ( $\glb$ ), 178.\¬
Glue, 41, 45--50, 54, 57--59, 80--81, 116, 125, 133, 199.
\*above and below displays, 92.
\*above and below insertions, 59.
\*at top of page, 59, 153.
\*before and after formulas, 199.
\*between lines, {\sl see} Interline glue.
\*between paragraphs, 57.
\*between words, {\sl see} Variable space.
\*between aligned columns or rows, 105--109.
\*setting of, 46, 99--103.\¬
Glue parameter definitions, 115, 119, 128, 136.\¬
\<glueparam\>, 119, 128, 136.\¬
Grave accent, 38, 132, 148.\¬
{\≡\grgr≡\} ( $\grgr$ ), 178.\¬
Grouping, 13, 15--18, 28, 62--63, 76, 84, 98, 115, 122.
\*within groups, 15--16.\¬
{\≡\Gscr≡\} ( $\Gscr$ ), 177.
\newletter h
{\≡\H≡\} (long Hungarian umlaut), 38, 132.\¬
{\≡\halign≡\} (horizontal alignment), 52, 88--89, 92, 104--109, 117, 127, 136,
140.\¬
{\≡! \halign in display ...≡\}, 95, 140.\¬
{\≡\hangindent≡\} (hanging indentation), 56, 101, 120, 129.\¬
Hanging indentation, 56, 101, 120, 129.\¬
{\tt hashsize}, 144.\¬
Hat accent, 38, 64, 132.\¬
{\≡\hbox≡\} (horizontal boxing), 52, 73, 93, 99--103, 105, 115, 124,
133, 145.\¬
Height, 41--45.
\*of completed page, 59.\¬
{\tt height}, 99.\¬
{\≡\hfil≡\} (horizontal glue semi-fill), 200.\¬
{\≡\hfill≡\} (horizontal glue fill), 50, 69, 109, 113, 125, 133, 145.\¬
{\≡\hfilneg≡\} (negative {\≡\hfil≡\}), 200.\¬
\<hlist\>, 99, 121.\¬
{\≡ht≡\} (height of saved box), 200.\¬
Horizontal braces, 103.\¬
Horizontal glue, 45--47, 50, 84, 125, 133.\¬
Horizontal list, 43--45, 99, 121.\¬
Horizontal mode, 23, 50--52, 57.
\*summary, 121--130.\¬
Horizontal rule, 43, 99, 101, 102, 105, 108--109, 115.\¬
{\≡\hrule≡\} (horizontal rule), 43, 99, 102, 108, 115, 148.\¬
{\≡\Hscr≡\} ( $\Hscr$ ), 177.\¬
{\≡\hsize≡\} (page width), 18, 20, 24--25, 50, 53, 56, 112--113, 119, 121, 128,
136, 150.\¬
{\≡\hskip≡\} (horizontal glue), 47, 50, 84, 125, 133.\¬
{\≡\hss≡\} (horizontal stretch and shrink), 200.\¬
Hyphen, 5--6, 54, {\sl see also} Discretionary hyphen.\¬
Hyphenation, 53--56, 180--186.\¬
Hyphenation penalties, 54, 56, 120, 129.
\newletter i
{\≡\i≡\} (dotless i), 39.\¬
{\tt idlevs}, 144.\¬
{\≡\if≡\} (test equality of characters), 33, 111--114, 121, 130, 137, 140, 150.\¬
{\≡\ifeven≡\} (test parity of counter), 33, 111--113, 121, 130, 137, 140, 150.\¬
{\≡\ifhmode≡\} (test horizontal mode), 200.\¬
{\≡\ifmmode≡\} (test math mode), 200.\¬
{\≡\ifpos≡\} (test sign of counter), 200.\¬
{\≡\ifvmode≡\} (test vertical mode), 200.\¬
Ignored character, 28, 30--31.\¬
Ignore space, 31, 106, 112, 124, 133.\¬
{\≡\iit≡\} (dotless $i$), 179.\¬
{\≡! Illegal ...≡\}, 141, 146.\¬
{\≡\imag≡\} ( $\imag$ ), 179.\¬
{\tt in} (inch), 40--41.\¬
{\≡\in≡\} ( $\in$ ), 61, 178.\¬
Indentation, 56, 116--117, {\sl see also} Hanging indentation.\¬
{\≡\inf≡\} (infimum operator), 72, 152.\¬
Infinite stretchability, 49--50.\¬
{\≡\infty≡\} ( $\infty$ ), 74, 179.\¬
{\≡\input≡\} (read specified file), 8, 19, 24--25, 121.\¬
Insertions, into manuscript, 22.
\*into pages, 59, 118, 127.\¬
{\≡\int≡\} ( $\int$ ), 69, 81, 149, 179.\¬
Integration, 69--70, 91.\¬
{\≡\inter≡\} ( $\inter$ ), 179.\¬
Inter-word glue, {\sl see} Variable space.\¬
{\≡\interc≡\} ( $\interc$ ), 178.\¬
Interline glue, 45, 58, 100, 109, 115, 199.\¬
{\≡\iota≡\} ( $\iota$ ), 177.\¬
{\≡\Iscr≡\} ( $\Iscr$ ), 177.\¬
{\tt it} fonts, 73--74, 125, 172.\¬
{\≡\it≡\} (italic), 153.\¬
Italic correction, 43, 124, 132, 134, 142, 149.\¬
Italic fonts, 73--74, 125, 172.\¬
Italic letters, 74.
\newletter j
{\≡\j≡\} (dotless j), 39.\¬
{\≡\jit≡\} (dotless $j$), 179.\¬
{\≡\join≡\} ( $\join$ ), 179.\¬
Jokes, 2.\¬
{\≡\jpar≡\} (justification feasibility parameter), 18, 25--26, 56, 120, 129,
143, 151.\¬
{\≡\Jscr≡\} ( $\Jscr$ ), 177.
\newletter k
{\≡\kappa≡\} ( $\kappa$ ), 177.\¬
Kerning, 6, 123.\¬
Knuth, Donald E., 1, 10, 15, 155.\¬
{\≡\Kscr≡\} ( $\Kscr$ ), 177.
\newletter l
{\≡\l≡\} (Polish accent), 38, 132, 148.\¬
{\≡\Lambda≡\} ( $\Lambda$ ), 177.\¬
{\≡\lambda≡\} ( $\lambda$ ), 88, 177.\¬
{\≡\Lambdait≡\} ( $\Lambdait$ ), 177.\¬
{\≡\langle≡\} ( $\langle$ ), 75, 178.\¬
Large delimiters, 74--79, 141.\¬
Large operators, 70, 73, 77--78.\¬
{\≡\lceil≡\} ( $\lceil$ ), 75, 178.\¬
{\≡\ldots≡\} ( $\ldots$ ), 49, 51, 86--87, 152.\¬
{\≡\ldotsm≡\} ({\≡\ldots≡\} in multiplication), 86--87, 149, 152.\¬
{\≡\ldotss≡\} ({\≡\ldots≡\} followed by space), 86--87, 96--97, 152.\¬
Leaders, 102--103, 116, 125, 139, 150.\¬
{\≡\leaders≡\} (leaders), 102--103, 116, 125, 139, 150.\¬
{\≡\left≡\} (variable-size left delimiter), 75--79, 82, 88--89, 96, 131.\¬
Left brace, 75, 79, 88.\¬
{\≡\leftset≡\} ($\{$ in set definition), 88, 152.\¬
{\≡\leftv≡\} ( $\leftv$ ), 87, 90, 178.\¬
{\≡\leftvv≡\} ( $\leftvv$ ), 87, 178.\¬
Letter, 28, 32.\¬
\<letter\>, 122, 131.\¬
{\≡\lfloor≡\} ( $\lfloor$ ), 75, 178.\¬
{\≡\lft≡\} (leftify), 89--90, 151.\¬
{\≡\lg≡\} (binary logarithm operator), 72, 151.\¬
Liang, Frank M., 180.\¬
Ligatures, 6, 10, 35, 123.\¬
{\≡\lim≡\} (limit operator), 72--73, 151.\¬
{\≡\liminf≡\} (inferior limit operator), 72, 151.\¬
Limits to operators, 70--71, 73, 134.\¬
{\≡\limitswitch≡\} (change position of limits), 70, 134, 142, 151.\¬
{\≡\limsup≡\} (superior limit operator), 72, 151.\¬
Line break penalties, 54, 56, 120, 126, 129, 135.\¬
Line breaking, 25--26, 52--57, 71, 101.\¬
\<line-feed\>\ ({\tt LF}), 32, 165.\¬
{\≡\≡\}\<line-feed\>, 12.\¬
Line rules, 43, 99, 101, 102, 105, 108--109, 115, 124.\¬
{\≡\lineskip≡\} (vertical glue between boxes with distant baselines), 58, 100, 109, 112,
115, 119, 128, 136, 149, 153, 199.\¬
{\≡\lineskiplimit≡\} (threshold that deter\-mines
when {\≡\lineskip≡\} begins), 199.\¬
{\≡\ln≡\} (natural logarithm operator), 72, 151.\¬
{\≡\log≡\} (logarithm operator), 72--73, 151.\¬
{\≡\lower≡\} (shift a box down), 102, 125, 133.\¬
{\≡\lowercase≡\} (no caps), 199.\¬
{\≡\lpile≡\} (left-justified pile), 90, 93, 152.\¬
{\≡\Lscr≡\} ( $\Lscr$ ), 177.\¬
{\≡\lscr≡\} ( $\lscr$ ), 177.\¬
{\≡\lsh≡\} ( $\lsh$ ), 178.\¬
{\≡\lsls≡\} ( $\lsls$ ), 178.\¬
{\≡\lub≡\} ( $\lub$ ), 178.
\newletter m
Macron accent, 38--39, 64, 132.\¬
Macros, definition of, {\sl see} {\≡\def≡\}.
\*expansion of, 98, 106--107, 147, 199.
\*tracing, 147.
\*use of, 96--99, 115, 122, 131.\¬
{\≡\mapsto≡\} ( $\mapsto$ ), 61, 178.\¬
Margins, {\sl see} {\≡\hsize≡\}, {\≡\hangindent≡\}.\¬
{\≡\mark≡\} (define a mark), 33, 110--112, 117, 141.\¬
Marks, 110--112, 117, 126, 135.\¬
Math formulas, breaking, 54--55, 84--85, 94--96, 120, 129.\¬
Math formulas, how to type, 60--96.\¬
Math mode, 33, 49, 50--52, 57.
\*character conversion in, 35, 60, 176.
\*summary, 130--138.\¬
{\≡\mathbin≡\} (Bin box), 84, 132.\¬
\<mathchar\>, 131--132.\¬
{\≡\mathclose≡\} (Close box), 84, 132.\¬
\<mathcontrol\>, 132.\¬
{\≡\mathex≡\} (define {\tt ex} font), 74, 118, 127, 153.\¬
\<mathglue\>, 133.\¬
{\≡\mathit≡\} (define {\tt it} font), 74, 119, 128, 153.\¬
{\≡\mathop≡\} (Op box), 84, 132.\¬
{\≡\mathopen≡\} (Open box), 84, 132.\¬
{\≡\mathpunct≡\} (Punct box), 84, 132.\¬
{\≡\mathrel≡\} (Rel box), 84, 132.\¬
{\≡\mathrm≡\} (define {\tt rm} font), 74, 119, 128, 153.\¬
{\≡\mathsurround≡\} (spaces around formulas), 199.\¬
{\≡\mathsy≡\} (define {\tt sy} font), 74, 119, 128, 153.\¬
\<mathstyle\>, 135.\¬
Matrices, 88--91, 104.\¬
{\≡\max≡\} (maximum operator), 72--73, 83, 151.\¬
{\≡\maxdepth≡\} (maximum page depth), 18, 59--60, 112--113, 119, 128, 136, 153.\¬
{\≡\meet≡\} ( $\meet$ ), 179.\¬
{\tt memsize}, 144.\¬
Metric units, 40.\¬
{\≡\min≡\} (minimum operator), 72, 83, 151.\¬
{\tt minus}, 47, 50.\¬
Minus sign, 5--6, 36, 60.\¬
{\≡! Missing ...≡\}, 21, 142.\¬
{\≡! Missing \cr ...≡\}, 115, 122, 142.\¬
{\≡! Missing \right≡\}, 131, 142.\¬
{\≡! Missing $ ...≡\}, 135, 142.\¬
{\≡! Missing {≡\}, 138, 142.\¬
{\≡! Missing }≡\}, 118, 127, 131, 142.\¬
\<mlist\>, 130.\¬
{\tt mm} (millimeter), 40.\¬
{\≡\mod≡\} (modulus operator), 88, 152.\¬
Modes, 23, 29, 50--52, 146.\¬
{\≡\modop≡\} (mod operator), 88, 149, 152, 154.\¬
{\≡\moveleft≡\} (shift a box left), 102, 116.\¬
{\≡\moveright≡\} (shift a box right), 102, 116.\¬
{\≡\mp≡\} ( $\mp$ ), 178.\¬
{\≡\Mscr≡\} ( $\Mscr$ ), 149, 177.\¬
{\≡\mu≡\} ( $\mu$ ), 177.\¬
{\≡\munion≡\} ( $\munion$ ), 179.
\newletter n
{\≡\nabla≡\} ( $\nabla$ ), 179.\¬
Narrow margins, 26, 53.\¬
Natural width of list, 46, 48, 101, 105.\¬
Negative dimensions, 44--45.\¬
Negative glue, 50, 81, 109.\¬
{\≡\neqv≡\} ( $\neqv$ ), 88, 152, 178.\¬
{\tt nestsize}, 144.\¬
Newspapers, 26.\¬
{\≡\noalign≡\} (disable alignment), 33, 93, 105, 107--108, 118, 127.\¬
{\≡\noindent≡\} (begin nonindented paragraph), 56, 112, 116.\¬
\<nonmathletter\>, 122.\¬
{\≡\not≡\} (cancel relation), 152, 178.\¬
{\≡\notin≡\} ( $\notin$ ), 178.\¬
{\≡\Nscr≡\} ( $\Nscr$ ), 177.\¬
{\≡\nu≡\} ( $\nu$ ), 177.\¬
{\≡\null≡\} (empty box of size zero), 59, 95--96, 107, 149, 152, 153.\¬
\<null\>\ ({\tt NUL}), 32, 165.\¬
\<number\>, 33, 34, 40--41.\¬
Number theory formulas, 88, 154.\¬
Numerator, 66, 134.
\newletter o
{\tt O} vs.\ {\tt 0}, 73, 81--82.\¬
{\≡\O≡\} ( \O\ ), 37, 122, 148.\¬
{\≡\o≡\} ( \o\ ), 37, 122.\¬
Octal notation, 34.\¬
{\≡\odiv≡\} ( $\odiv$ ), 178.\¬
{\≡\odot≡\} ( $\odot$ ), 178.\¬
{\≡\odotprod≡\} ( $\odotprod$ ), 179.\¬
{\≡\OE≡\} ( \OE\ ), 37, 122.\¬
{\≡\oe≡\} ( \oe\ ), 37, 54, 122.\¬
{\≡\oint≡\} ( $\oint$ ), 179.\¬
{\≡\Omega≡\} ( $\Omega$ ), 177.\¬
{\≡\omega≡\} ( $\omega$ ), 61, 177.\¬
{\≡\Omegait≡\} ( $\Omegait$ ), 177.\¬
{\≡\ominus≡\} ( $\ominus$ ), 178.\¬
On-line editing, 22, 147.\¬
Op box, 82--84, 132, 134, 142, 176.\¬
Open box, 82--84, 133, 176.\¬
{\≡\oplus≡\} ( $\oplus$ ), 10, 178.\¬
{\≡\oprod≡\} ( $\oprod$ ), 179.\¬
\<optional sign\>, 40.\¬
Ord box, 82--84, 132, 176.\¬
Organs, 29.\¬
{\≡\Oscr≡\} ( $\Oscr$ ), 177.\¬
{\≡\osum≡\} ( $\osum$ ), 179.\¬
Other character, 28, 32.\¬
\<otherchar\>, 28, 32, 122, 131.\¬
{\≡\otimes≡\} ( $\otimes$ ), 178.\¬
{\≡\output≡\} (define output routine), 18, 33, 59--60, 98, 104, 109--114, 120, 129, 137,
141, 147, 153, 166.\¬
Output routines, {\sl see} {\≡\output≡\}.\¬
{\≡\over≡\} (specify built-up fraction), 64, 82, 130, 134, 139, 149.\¬
{\≡\overline≡\} (put line over formula), 63, 67, 82, 132, 134.\¬
Overfull box, 25--26, 143, 147.
\newletter p
{\≡\P≡\} ( $\P$ ), 61, 179.\¬
{\≡\page≡\} (completed page), 60, 102, 111, 113, 115--116, 124, 133, 143.\¬
Page break, 57--60.\¬
Page break penalties, 58--59, 117, 120, 129.\¬
Page building, 57--60.\¬
Page numbers, 59--60, 111--113.\¬
{\≡par≡\} \<dimen\>, 33, 101, 115, 124, 133.\¬
{\≡par size≡\}, 167.\¬
{\≡\par≡\} (end of paragraph), 23, 28, 30--32, 51, 57, 114, 125, 135, 146.\¬
Paragraph, beginning of, 56, 116--117.
\*ending of, {\sl see} {\≡\par≡\}.\¬
Parameter, 97.\¬
Parameter text, 97--98.\¬
Parameters to \smallTEX,
{\sl see} {\≡\chpar≡\}, Glue parameters, Dimension parameters,
Size parameters.\¬
Parentheses, 42, 75.\¬
{\≡\parindent≡\} (amount of indentation at beginning of paragraph), 18, 56, 117,
119, 128, 136, 153.\¬
{\tt parsize}, 144.\¬
{\≡\parskip≡\} (additional glue between para\-graphs), 57, 116, 119, 128, 136,
153.\¬
{\≡\partial≡\} ( $\partial$ ), 149, 179.\¬
{\tt pc} (pica), 40.\¬
Penalties, 27, 54--59, 84, 105, 107, 117, 120, 126, 129, 135.
\* for hyphenation, 54, 56, 120, 129.\¬
{\≡\penalty≡\} (line or page break penalty), 27, 54--57, 84, 107, 117, 126, 135.\¬
Period, 48--49, 71--72, 82.\¬
{\≡\perp≡\} ( $\perp$ ), 178.\¬
{\≡\Phi≡\} ( $\Phi$ ), 177.\¬
{\≡\phi≡\} ( $\phi$ ), 61, 177.\¬
{\≡\Phiit≡\} ( $\Phiit$ ), 177.\¬
{\≡\Pi≡\} ( $\Pi$ ), 177.\¬
{\≡\pi≡\} ( $\pi$ ), 52, 149, 177.\¬
Pica, 40.\¬
{\≡\Piit≡\} ( $\Piit$ ), 177.\¬
{\tt plus}, 47, 50.\¬
{\≡\pm≡\} ( $\pm$ ), 178.\¬
Point, 40--41.\¬
Polish crossed l and L, 38--39.\¬
{\≡\Pr≡\} (probability operator), 72, 152.\¬
Preamble to an alignment, 104--109.\¬
{\≡\prec≡\} ( $\prec$ ), 178.\¬
{\≡\preceq≡\} ( $\preceq$ ), 178.\¬
Pretzels, 79.\¬
{\≡\prime≡\} ( $\prime$ ), 63, 179.\¬
{\≡\prod≡\} ( $\prod$ ), 179.\¬
Proper names, 53.\¬
{\≡\Pscr≡\} ( $\Pscr$ ), 149, 177.\¬
{\≡\Psi≡\} ( $\Psi$ ), 177.\¬
{\≡\psi≡\} ( $\psi$ ), 177.\¬
{\≡\Psiit≡\} ( $\Psiit$ ), 177.\¬
{\tt pt} (point), 40, 78, 141.\¬
Punct box, 82--84, 133, 176.\¬
Punctuation marks, 48, 53.
\*in math formulas, 71--72.
\newletter q
{\≡\qquad≡\} (double quad space), 80, 89, 152.\¬
{\≡\Qscr≡\} ( $\Qscr$ ), 177.\¬
{\≡\quad≡\} (quad space), 80--81, 88--89, 123, 133.\¬
Quad middle, 57.\¬
Quads, 40, 80.\¬
Question mark, 48, 71.\¬
Quotation marks, 4--7, 20, 35, 48.
\newletter r
{\≡\ragged≡\} (degree of raggedness), 25--26, 56, 120, 129, 151.\¬
Ragged right margins, 26, 56.\¬
{\≡\raise≡\} (shift a box up), 63, 102, 125, 133, 139.\¬
{\≡\rangle≡\} ( $\rangle$ ), 75, 178.\¬
{\≡\rceil≡\} ( $\rceil$ ), 75, 178.\¬
{\≡\real≡\} ( $\real$ ), 179.\¬
Recovery from errors, 21--27, 114--115, 122, 131, 138--148.\¬
Reference point, 42--45.\¬
Rel box, 82--85, 133, 176.\¬
Relations, 55--56, 82--83, 96, 178.\¬
{\≡\relv≡\} ( $\relv$ ), 87--88, 178.\¬
{\≡\relvv≡\} ( $\relvv$ ), 87, 178.\¬
Restricted horizontal mode, 50, 52.
\*summary, 121--130.\¬
Restricted vertical mode, 33, 50, 52.
\*summary, 114--121.\¬
Result text, 97--99.\¬
{\≡\rfloor≡\} ( $\rfloor$ ), 75, 178.\¬
{\≡\rho≡\} ( $\rho$ ), 177.\¬
{\≡\right≡\} (variable-size right delimiter), 75--79, 82, 88--89, 96, 131.\¬
Right brace, 88.\¬
Right justification, 50, 151.\¬
{\≡\rightset≡\} ($\}$ in set definition), 88, 152.\¬
{\≡\rightv≡\} ( $\rightv$ ), 87, 90, 178.\¬
{\≡\rightvv≡\} ( $\rightvv$ ), 87, 178.\¬
{\≡\rjustline≡\} (right justify a line), 151.\¬
{\tt rm} fonts, 73--74, 125, 170.\¬
{\≡\rm≡\} (roman), 12, 153.\¬
Roman fonts, 170.\¬
Roman letters in formulas, 72--74.\¬
Roman numerals, 111.\¬
Roots, 63.\¬
{\≡\rpile≡\} (right-justified pile), 90, 152.\¬
{\≡\Rscr≡\} ( $\Rscr$ ), 177.\¬
{\≡\rsh≡\} ( $\rsh$ ), 178.\¬
{\≡\rslash≡\} ( $\rslash$ ), 178.\¬
{\≡\rt≡\} (rightify), 89, 151.\¬
Rule box (line rule), 43, 99, 101, 102, 105, 108--109, 115, 124.\¬
Rulers, 41.\¬
Runaway argument, 141.\¬
Running headline, 112, 155.\¬
Running \smallTEX, 18--27.
\newletter s
{\≡\s≡\} (tilde), 38, 64, 132.\¬
{\≡\save≡\} (save a box), 101, 113--114, 116, 125, 133, 139.\¬
{\tt savesize}, 144.\¬
Scandinavian circle accent, 38--39, 132.\¬
Script letters, 10, 177.\¬
Script size, 65, 74.\¬
Script style, 65--67.\¬
Scriptscript size, 66, 74.\¬
Scriptscript style, 65--67.\¬
{\≡\scriptscriptstyle≡\} (script\-script style), 63, 68, 135.\¬
{\≡\scriptstyle≡\} (script style), 68, 71, 135, 149.\¬
{\≡\sec≡\} (secant operator), 72, 151.\¬
{\≡\section≡\} ( $\section$ ), 61, 179.\¬
Semicolon, 48, 71, 82.\¬
{\≡\setcount≡\} (set a counter), 111, 120, 129, 137.\¬
Sets in math, 61, 88.\¬
Setting glue, 46, 99--103.\¬
Shifted boxes, 102, 116, 125, 133.\¬
Shrink component of glue, 45--50, 55, 58, 101.\¬
{\≡\Sigma≡\} ( $\Sigma$ ), 177.\¬
{\≡\sigma≡\} ( $\sigma$ ), 177.\¬
{\≡\Sigmait≡\} ( $\Sigmait$ ), 177.\¬
{\≡\simeq≡\} ( $\simeq$ ), 178.\¬
{\≡\sin≡\} (sine operator), 72--73, 151.\¬
{\tt size}, 33, 100, 104, 115, 124, 133.\¬
{\≡\sl≡\} (slanted roman), 12, 17, 153.\¬
Slanted type, 157.\¬
Slash, 36, 82.\¬
Slavic h\'a\v cek accent, 38, 132.\¬
{\≡\smallint≡\} ( $\smallint$ ), 179.\¬
Space, {\sl see} Blank space character, Glue, Variable space.\¬
\<space\>, 114, 121, 123, 124, 131.\¬
Space component of glue, 45--50.\¬
Space factor, 48, 53.\¬
Spacing in math formulas, 79--84, 87--88, 199.\¬
\*tables, 81, 83.\¬
\<spec\>, 33, 115, 124, 133.\¬
{\≡\spose≡\} (superpose), 39, 63, 108--109, 152.\¬
{\≡\sqrt≡\} (square root), 63, 67, 74--75, 78, 81--82, 132, 134.\¬
{\≡\sqsub≡\} ( $\sqsub$ ), 178.\¬
Square root, {\sl see} {\≡\sqrt≡\}.\¬
{\≡\squnion≡\} ( $\squnion$ ), 179.\¬
{\≡\ss≡\} ( \ss\ ), 37, 122, 148.\¬
{\≡\Sscr≡\} ( $\Sscr$ ), 177.\¬
{\tt stacksize}, 144.\¬
Stanford conventions, 19, 24, 198.\¬
States, 29--33.\¬
{\≡\sterling≡\} ( $\sterling$ ), 61, 179.\¬
Stopping \smallTEX, 22, 121.\¬
Stretch component of glue, 45--50, 55.
\*infinite, 49--50.\¬
{\tt stringsize}, 144.\¬
Styles of math setting, 65--67, 130, 135.\¬
SUAI code, 18, 35, 169.\¬
Subformula, 82, 130--131.\¬
Subscript, 62--63, 66, 84, 132, 134, 140.\¬
{\≡\subset≡\} ( $\subset$ ), 178.\¬
{\≡\succ≡\} ( $\succ$ ), 178.\¬
{\≡\succeq≡\} ( $\succeq$ ), 178.\¬
{\≡\sum≡\} ( $\sum$ ), 64, 69, 77--78, 96, 149, 179.\¬
Summation, 69--71, 91.\¬
{\≡\sup≡\} (supremum operator), 72, 152.\¬
Superposition, 63, 101, 108--109, 152.\¬
Superscripts, 62--63, 66, 78, 84, 132, 134, 140.\¬
{\≡\supset≡\} ( $\supset$ ), 178.\¬
{\≡\surd≡\} ( $\surd$ ), 179.\¬
{\tt sy} fonts, 73--74, 79, 125, 173.\¬
Symbol fonts, 73--74, 79, 125, 173.
\newletter t
{\≡\t≡\} (tie), 38, 132, 148.\¬
\<tab\>\ ({\tt TAB}), 32, 165.\¬
{\≡\≡\}\<tab\>, 12.\¬
{\≡\tabskip≡\} (glue in alignments), 18, 105--109, 118, 119, 127, 128, 136.\¬
{\≡\tan≡\} (tangent operator), 72, 151.\¬
{\≡\tau≡\} ( $\tau$ ), 4, 177.\¬
{\≡\TEX≡\} (\smallTEX\ logo), 9, 17.\¬
\smallTEX, meaning of, 4.\¬
\smallTEX\ logo, 9, 17, 44.\¬
Text size, 66, 74.\¬
Text style, 65--67.\¬
{\≡\textindent≡\} (insert text into paragraph indent), 159, 165.\¬
{\≡\textstyle≡\} (text style), 68, 135.\¬
{\tt.TFX}, 198.\¬
Theorems, 157--158.\¬
{\≡! There's no ...≡\}, 117, 126, 135, 144.\¬
{\≡\Theta≡\} ( $\Theta$ ), 177.\¬
{\≡\theta≡\} ( $\theta$ ), 61, 73, 177.\¬
{\≡\Thetait≡\} ( $\Thetait$ ), 177.\¬
Thick space, 80--84.\¬
Thin space, 7, 71, 80--84, 88, 133, 151--152.\¬
Three-column format, 113--114.\¬
Three dots, 85--87, 90--91.\¬
Tie accent, 38, 132, 148.\¬
Tilde accent, 38, 64, 132.\¬
{\≡\times≡\} ( $\times$ ), 178.\¬
{\tt to} \<dimen\>, 33, 100--101, 104, 115, 124, 133, 145.\¬
{\tt to size}, 100, 104, 115, 124, 133.\¬
Tokens, 22, 97--98, 146.\¬
{\≡! Too many ...≡\}, 115, 122, 145.\¬
{\≡\top≡\} ( $\top$ ), 179.\¬
{\≡\topbaseline≡\} (normal position of top baseline on page), 18, 59, 119, 128,
136, 153.\¬
{\≡\topinsert≡\} (insertion at top of page), 52, 54, 57, 59, 118, 127.\¬
{\≡\topmark≡\} (current mark at top of page), 110--112, 117, 126, 135, 166, 199.\¬
{\≡\topskip≡\} (glue below {\≡\topinsert≡\}), 59, 119, 128, 136.\¬
{\≡\trace≡\} (combination of tracing facilities), 18, 98, 120, 121, 129, 130, 137,
142, 147, 151.\¬
Tracing, 147.\¬
Translation of characters in math mode, 35, 60, 176.\¬
Truth, 2.\¬
{\≡\Tscr≡\} ( $\Tscr$ ), 177.\¬
Two-column format, 113--114.\¬
{\≡\twoline≡\} (two line display), 94--96, 152.\¬
Typewriter fonts, 171.\¬
Typewriter type used in this manual, 5.
\newletter u
{\≡\u≡\} (breve), 38--39, 132.\¬
Umlaut accent, 8, 23, 35, 38, 132, 148.\¬
{\≡! Undefined ...≡\}, 21, 114, 122, 131, 145.\¬
{\≡\underline≡\} (put line under formula), 11, 63, 67, 82, 132, 134.\¬
Underlining, 162, {\sl see also} {\≡\underline≡\}.\¬
{\≡\union≡\} ( $\union$ ), 179.\¬
Units of measure, 33, 40--41, 199--200.\¬
{\≡\unskip≡\} (retract a space), 199.\¬
{\≡\up≡\} ( $\up$ ), 178.\¬
{\≡\uplus≡\} ( $\uplus$ ), 178.\¬
{\≡\uppercase≡\} (all caps), 199.\¬
{\≡\Upsilon≡\} ( $\Upsilon$ ), 177.\¬
{\≡\upsilon≡\} ( $\upsilon$ ), 177.\¬
{\≡\Upsilonit≡\} ( $\Upsilonit$ ), 177.\¬
{\≡\Uscr≡\} ( $\Uscr$ ), 177.\¬
{\≡! Use of ...≡\}, 97, 145.
\newletter v
{\≡\v≡\} (Slavic h\'a\v cek accent), 38, 132.\¬
{\≡\valign≡\} (vertical alignment), 52, 104, 109, 115, 118, 126.\¬
Variable-size delimiters, 74--79.\¬
Variable space, 26, 48.\¬
{\≡\varomega≡\} ( $\varomega$ ), 61, 177.\¬
{\≡\varphi≡\} ( $\varphi$ ), 61, 177.\¬
{\tt varsize}, 144.\¬
{\≡\vartheta≡\} ( $\vartheta$ ), 61, 177.\¬
{\≡\varunit≡\} (variable unit), 199.\¬
{\≡\vbox≡\} (vertical boxing), 52, 100--103, 107, 112--113, 115, 124, 133.\¬
{\≡\vcenter≡\} (vertically center a \<vlist\>\ box), 88--89, 93, 102, 107, 135.\¬
{\≡\vdash≡\} ( $\vdash$ ), 178.\¬
{\≡\vdots≡\} (vertical ellipsis), 90--91, 152.\¬
Vector, 85--86, 91, 96--97.\¬
Vector accent, 38, 64, 132.\¬
Vertical glue, 20, 40, 47, 58, 105, 112, 116, 146.\¬
Vertical lines in math, 75, 87.\¬
Vertical list, 43--45, 114.\¬
Vertical mode, 33, 50--52, 57.
\*summary, 114--121.\¬
Vertical rules, 43, 99, 101, 102, 108--109, 124.\¬
{\≡\≡\}\<vertical-tab\>, 12.\¬
\<vertical-tab\>\ ({\tt VT}), 32, 165.\¬
{\≡\vfil≡\} (vertical glue semi-fill), 200.\¬
{\≡\vfill≡\} (vertical glue fill), 23, 50, 52, 58, 112--113, 116.\¬
{\≡\vfilneg≡\} (negative {\≡\vfil≡\}, 200.\¬
\<vlist\>, 100, 105, 114.\¬
Vowel, 181.\¬
{\≡\vrule≡\} (vertical rule), 43, 99, 108, 124, 148.\¬
{\≡\Vscr≡\} ( $\Vscr$ ), 177.\¬
{\≡\vsize≡\} (page height), 18, 59, 112--113, 119, 121, 128, 136.\¬
{\≡\vskip≡\} (vertical glue), 20, 40, 47, 58, 112, 116, 146.\¬
{\≡\vss≡\} (vertical stretch and shrink), 200.\¬
{\≡\vtop≡\} (make \<vlist\>\ box using top baseline), 102, 135.\¬
{\≡vu≡\} (variable unit), 199.
\newletter w
{\tt Warning: ...}, 145, 198.\¬
{\≡wd≡\} (width of saved box), 200.\¬
Widow lines, penalty for, 58--59, 120, 129.\¬
Width, 41--45.\¬
{\tt width}, 99.\¬
{\≡\wp≡\} ( $\wp$ ), 179.\¬
{\≡\Wscr≡\} ( $\Wscr$ ), 177.
\newletter x
{\≡\x≡\} (extension), 117, 126, 135.\¬
{\≡\xdef≡\} (expanded definition), 199.\¬
XGP, 20, 24, 198.\¬
{\tt xgp}, 198.\¬
{\≡\Xi≡\} ( $\Xi$ ), 177.\¬
{\≡\xi≡\} ( $\xi$ ), 177.\¬
{\≡\Xiit≡\} ( $\Xiit$ ), 177.\¬
{\≡\Xscr≡\} ( $\Xscr$ ), 177.\¬
{\≡\xskip≡\} (additional space in text), 47, 158--160, 165.
\newletter y
{\≡! You can't ...≡\}, 121, 130, 138, 146.\¬
{\≡\Yscr≡\} ( $\Yscr$ ), 177.\¬
{\≡\yskip≡\} (extra space between paragraphs), 47, 159, 165.\¬
{\≡\yyskip≡\} (double {\≡\yskip≡\}), 47, 159, 165.
\newletter z
{\≡\zeta≡\} ( $\zeta$ ), 177.\¬
{\≡\Zscr≡\} ( $\Zscr$ ), 10, 177.
\newletter 0
7-bit character codes, 32, 34--35, 122, 168--173.\¬
{\≡\9≡\} (digit-width space), 164, 165.\¬
9-bit character codes, 74, 79, 132, 141, 176.
\newletter .
\<\ \>, ({\tt SP}), 32, 165.\¬
{\tt\char'40}, 5.\¬
{\≡\≡char'40≡\}, 8--9, 12, 33, 49, 81, 123, 133.\¬
{\≡\!≡\} (negative thin space or ignore space), 31, 81, 106, 112, 124, 133.\¬
{\≡\"≡\} (umlaut), 8, 23, 35, 38, 132, 148.\¬
{\≡#≡\}, 28, 97--98, 104--109, 142.\¬
{\≡\#≡\} ( $\#$ ), 179.\¬
{\≡##≡\}, 97--99.\¬
{\≡$≡\}, 28, 29, 51, 60, 66, 125, 131.\¬
{\≡\$≡\} ( $\$$ ), 61, 108, 179.\¬
{\≡$$≡\}, 33, 51--52, 66, 125--126.\¬
{\≡%≡\}, 28, 34.\¬
{\≡\%≡\} ( \%\ ), 34, 151.\¬
{\≡\≡`≡\} (grave accent), 38, 132, 148.\¬
{\≡≡'≡\} (octal number), 34.\¬
{\≡\≡'≡\} (acute accent), 8, 10, 38, 132.\¬
{\≡\*≡\} (discretionary $\times$), 55, 84, 85, 134.\¬
{\≡\,≡\} (thin space), 7, 81--84, 88, 133, 151--152.\¬
{\≡-≡\}, 36, 123.\¬
{\≡\-≡\} (discretionary hyphen), 26, 54, 124.\¬
{\≡/≡\}, 36, 82.\¬
{\≡\/≡\} (italic correction), 43, 124, 142.\¬
{\≡\≡\}, 7, 28.\¬
{\≡\:≡\} (select current font), 12--15, 18, 36, 118-119, 127--128, 136.\¬
{\≡\;≡\} (thick space), 81, 83--84, 133.\¬
{\≡\<≡\} (negative op space), 81, 133, 152.\¬
{\≡\≡≤≡\} (negative conditional thin space), 81, 133.\¬
{\≡\=≡\} (macron), 38--39, 64, 132.\¬
{\≡\≡≥≡\} (conditional thin space), 81, 83, 133, 152.\¬
{\≡\>≡\} (op space), 81, 83, 133.\¬
{\≡\?≡\} (negative thick space), 81, 133.\¬
{\≡{≡\}, 15--16, 28, 62--63, 115, 121, 122, 131.\¬
{\≡\{≡\} ( $\{$ ), 75, 90, 178.\¬
{\≡}≡\}, 15--16, 28, 62--63, 115, 121, 122, 131, 141.\¬
{\≡\}≡\} ( $\}$ ), 75, 178.\¬
{\≡↑≡\}, 28, 62--63, 70, 132, 140.\¬
{\≡\↑≡\} ( $\↑$ ), 178.\¬
{\≡≡↓≡\}, 28, 62--63, 70, 73, 132, 140.\¬
{\≡\≡↓≡\} ( $\↓$ ), 178.\¬
{\tt←}, 179.\¬
{\≡\←≡\} ( $\←$ ), 10, 178.\¬
{\≡→≡\}, 176.\¬
{\≡\→≡\} ( $\→$ ), 178.\¬
{\≡\≡spose←≡\}\hskip2pt{\≡→≡\} ( $\↔$ ), 178.\¬
{\≡\@≡\} ( $\@$ ), 179.\¬
$α$, 35.\¬
{\≡\|≡\} ( $\|$ ), 75, 179.\¬
{\≡⊗≡\}, 28, 88--89, 104--108, 117--118, 126--127, 135, 144.\¬
$\ldotss$, 49, 85--87, 90--91.
\par\vfill
\postindexappbegin S. {Special notes about using \TEX\ at Stanford}
(1) The standard \TEX\ program that you get by typing ``{\tt r tex}''
requires that fonts {\tt @}, {\tt a}, {\tt d}, {\tt f}, {\tt g}, {\tt j}, {\tt l},
{\tt n}, {\tt q}, {\tt u}, {\tt x}, {\tt z}, and {\tt ?} be reserved for
the fonts declared in Appendix B.\xskip (The reason is that the system program
already has the font information for these fonts in its memory; this avoids
making \TEX\ reload thirteen separate font information files each time.)
\yskip\noindent
(2) The standard \TEX\ program produces output for the XGP. To produce output
for the Alphatype (when it is available) we will use another program ``{\tt
texa}''.
\yskip\noindent
(3) You can type ``{\tt xgp}'' before a unit of measure, to avoid the expansion
factor. For example, ``{\≡\hsize 3 xgpin≡\}'' gives $3\times200$ pixels, which
equals 3 inches (more or less) on our XGP.
\yskip\noindent
(4) The extension ``{\tt.TEX}'' is assumed to apply to {\≡\input≡\} file
names if you do not specify the extension. If \TEX\ can't find the file
in your area, it tries system area {\tt[1,3]}
before giving up.\xskip (File {\tt basic.TEX} is on this area.)\xskip
Your output file will have the same name as the first file you {\≡\input≡\},
except that the extension will be changed to ``{\tt XGP}''.
\yskip\noindent
(5) The message ``{\tt Warning: page limits exceeded!}''
is given when you try to output something below the place where the output
page is cut, i.e., more than one xgp inch below the bottom of the box
output by the {\≡\output≡\} routine.
\danger (6) If a font you are using isn't on area {\tt[XGP,SYS]}, you must
mention the area explicitly. \TEX\ ignores the extension on font file names;
the XGP server will assume that the extension is ``{\tt.FNT}'', and \TEX\
assumes that the font information is on another file with the extension
``{\tt.TFX}''.\xskip (This applies to XGP fonts only; Alphatype fonts will be on
area {\tt[ALP,SYS]}, and the corresponding \TEX\ font information will have
extension ``{\tt.TFA}''.)
\ddanger (7) Documentation for the \TEX\ processor appears in the file
{\tt TEXSYS.SAI} on area {\tt[TEX,DEK]}, and in several other files mentioned there.
\yyskip\noindent\hangindent 55pt for 2
\hbox to 0pt{\hskip-53pt\:@\char'177\char'177\char'177\hfill}\ninepoint
(8) The implementation of \TEX\ is explicitly designed so that extensions can
be written in SAIL and incorporated into your private version of the system.
You write a module called {\tt TEXEXT.SAI} and this replaces the dummy extension
module that is ordinarily loaded with the \TEX\ processor.
\vfill
\specialappbegin X. {Recent extensions to \TEX}
Stop the presses!
The following features were added to \TEX\ just before this manual was printed:
\def\⊃#1. {\yyskip\noindent\hbox to 19pt{\bf#1.\hfill}}
\def\<{$\langle$}\def\>{$\rangle$}
\⊃1. Several new \<dimenparam\>s have joined {\≡\hsize≡\},
{\≡\vsize≡\}, {\≡\topbaseline≡\}, etc.,
namely {\≡\lineskiplimit≡\}, {\≡\mathsurround≡\}, and {\≡\varunit≡\}.
By typing ``{\≡\lineskiplimit≡\} \<dimen\>'' you specify a dimension $p$ such that
{\≡\lineskip≡\} glue is used as the interline glue if and only if $x-h-d<p$, in
the notation of Chapter 15.
By typing ``{\≡\mathsurround≡\} \<dimen\>'' you specify an amount
of blank space to be inserted at the left and right of any formula
embedded in text (i.e., formulas delimited by {\≡$≡\} and {\≡$≡\}).
By typing ``{\≡\varunit≡\} \<dimen\>'' you specify the current value of a
variable-size unit; the code {\≡vu≡\} denotes such relative units in a \<dimen\>\
specification. For example, after you define ``{\≡\varunit 2pt≡\}'', a \<dimen\>\
of {\≡7vu≡\} would stand for 14 points. When \TEX\ begins, the values of
{\≡\lineskiplimit≡\}, {\≡\mathsurround≡\}, and {\≡\varunit≡\} are {\tt 0pt},
{\tt 0pt}, and {\tt 1pt}, respectively.
\⊃2. There is a new option to {\≡\advcount≡\}:
If you type ``{\≡\advcount≡\} \<digit\>\ {\≡by≡\} \<number\>'',
the specified counter is increased by the specified number.\xskip
(When the ``{\≡by≡\}'' option
is omitted, the counter is increased by plus-or-minus one as explained
before.)\xskip
For example, ``{\≡\advcount0 by -\count1≡\}'' subtracts counter 1 from counter 0.
\⊃3. The control sequence {\≡\unskip≡\}
can be used in horizontal mode (or restricted
horizontal mode) to delete one glob of glue, if this glue was the last item
added to the horizontal list. The main use of this is to remove an unwanted space
that may have just appeared. For example, in a macro expansion the string
``{\≡#1\unskip≡\}''
denotes parameter {\≡#1≡\} with a final blank space (or other glue) removed,
if {\≡#1≡\} ends with a blank space (or other glue).
\⊃4. Typing ``{\≡\uppercase{≡\}\<token list\>{\≡}≡\}'' in horizontal mode
will change all lower-case
letters of the token list into upper case.\xskip (But not the letters of control
sequences.)\xskip Similarly, ``{\≡\lowercase{≡\}\<token list\>{\≡}≡\}''
changes upper-case letters into lower case.
\⊃5. Typing ``{\≡\xdef≡\}\<control sequence\>{\≡{≡\}\<result text\>{\≡}≡\}''
is just like ``{\≡\gdef≡\}\<control sequence\>{\≡{≡\}\<result text\>{\≡}≡\}''
except that definitions in the result text are expanded. For example,
``{\≡\xdef\z{\z\y}≡\}'' will append the current result
text of macro {\≡\y≡\} to the current result text of macro {\≡\z≡\}.
You can also use {\≡\xdef≡\} to expand {\≡\count≡\}s
(as well as {\≡\topmark≡\}s, etc., in {\≡\output≡\} routines).
\⊃6. The new control sequence {\≡\ifpos≡\} is analogous to {\≡\ifeven≡\}; the
{\≡\else≡\} code is evaluated only if the specified counter is zero or negative.
For example, you can use {\≡\ifpos≡\} to test if a counter is zero in the
following way:
$$\vbox{\halign{#\hfill\cr
{\≡\def\neg#1{\setcount#1-\count#1}≡\}\cr
{\≡\def\ifzero#1#2\else#3{\ifpos#1{#3}\else{\neg#1≡\}\cr
{\≡≡ ≡ ≡ ≡ \ifpos#1{\neg#1 #3}\else{\neg#1 #2}}}≡\}\cr}}$$
\⊃7. {\≡\chcode≡\} has been extended to give you the opportunity to change
\TEX's math mode conversion (Appendix F8). Say ``{\≡\chcode≡\} $\langle$ascii
code plus \char16 200$\rangle${\≡←≡'≡\}$\langle$type$\rangle\langle$char$\rangle$''
where $\langle$type$\rangle$ is 0, 1, 2, 3, 4, 5, 6 for Ord, Op, Bin, Rel, Open,
Close, Punct, respectively, and $\langle$char$\rangle$ is the three-octal-digit
code. For example, a colon (ascii code \char16 072) is normally treated by \TEX\
as Ord\char16 072, according to Appendix F8. It turns out this is usually a
mistake in computer science papers, it should rather be Rel\char16 072
(treated as a relation box with respect to spacing in formulas, see Chapter 18.4).
You can get this by typing ``{\≡\chcode≡'272←≡'3072≡\}''.\xskip
(Then formulas like ``$x\mathrel:=x+1$'' and ``$f\mathrel:X→Y$'' will come
out properly.)
\⊃8. Three new units of measure are allowed: {\tt wd}$\langle$digit$\rangle$,
{\tt ht}$\langle$digit$\rangle$, {\tt dp}$\langle$digit$\rangle$,
denoting the width, height, and depth of a saved box. For example, if you
type ``{\≡\save5\hbox{k}\hbox to 2 wd5{}≡\}'' you get an empty box that is twice the
width of the letter k in the current font.
\⊃9. You can use a single letter where \TEX\ expects a $\langle$number$\rangle$;
the result is the ascii code of that letter. For example, the definition of
{\≡\max≡\} in Appendix B would now more properly be
$$\hbox{\≡\def\max{\mathop{\char m \char a \char x}}≡\}\quad.$$
This works only for letters (characters of type 11, see Chapter 7).
\⊃10. The new control sequences {\≡\ifvmode≡\}, {\≡\ifhmode≡\}, {\≡\ifmmode≡\}
(analogous to other {\≡\if≡\}'s) select text based on the current mode.
\⊃11. The new control sequences {\≡\hfil≡\}, {\≡\hfilneg≡\}, {\≡\hss≡\}
are short for {\≡\hskip≡\} {\tt 0pt} {\tt plus} {\tt 100000pt},
{\≡\hskip≡\} {\tt 0pt} {\tt plus} {\tt -100000pt},
{\≡\hskip≡\} {\tt 0pt} {\tt plus} {\tt 100000pt} {\tt minus} {\tt 100000pt},
respectively, and they take less \TEX\ memory space. The vertical analogs are
{\≡\vfil≡\}, {\≡\vfilneg≡\}, and {\≡\vss≡\}. Examples of
use: ``{\≡\vfil\penalty0\vfilneg≡\}'' specifies an optional page break, with a
``short'' page if the break occurs; ``{\≡\penalty1000\hfilneg\≡char'40≡\}''
at the end of a paragraph will force
the last line of the paragraph to be right justified (it cancels the paragraph-fill
glue supplied automatically by \TEX).
\vfill
\end